1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

remove scriptname from scripts

This commit is contained in:
Adam 2018-01-19 20:17:49 +11:00
parent c568a998c3
commit 4b9da92b34
23 changed files with 108 additions and 115 deletions

View file

@ -3,7 +3,7 @@
class CmnDefCutSceneReplay : public EventScript class CmnDefCutSceneReplay : public EventScript
{ {
public: public:
CmnDefCutSceneReplay() : EventScript( "CmnDefCutSceneReplay", 721028 ) CmnDefCutSceneReplay() : EventScript( 721028 )
{} {}
void Scene00000( Entity::Player& player ) void Scene00000( Entity::Player& player )

View file

@ -3,7 +3,7 @@
class CmnDefInnBed : public EventScript class CmnDefInnBed : public EventScript
{ {
public: public:
CmnDefInnBed() : EventScript( "CmnDefInnBed", 720916 ) CmnDefInnBed() : EventScript( 720916 )
{} {}
// menu // menu

View file

@ -7,7 +7,7 @@
class CmnDefLinkShell : public EventScript class CmnDefLinkShell : public EventScript
{ {
public: public:
CmnDefLinkShell() : EventScript( "CmnDefLinkShell", 0xB0006 ) CmnDefLinkShell() : EventScript( 0xB0006 )
{} {}
void Scene00001( Entity::Player& player ) void Scene00001( Entity::Player& player )

View file

@ -3,7 +3,7 @@
class HouFurOrchestrion : public EventScript class HouFurOrchestrion : public EventScript
{ {
public: public:
HouFurOrchestrion() : EventScript( "HouFurOrchestrion", 721226 ) HouFurOrchestrion() : EventScript( 721226 )
{} {}
void Scene00000( Entity::Player& player ) void Scene00000( Entity::Player& player )

View file

@ -3,7 +3,7 @@
class ActionSprint3 : public ActionScript class ActionSprint3 : public ActionScript
{ {
public: public:
ActionSprint3() : ActionScript( "ActionSprint3", 3 ) ActionSprint3() : ActionScript( 3 )
{} {}
void onCastFinish( Core::Entity::Player& player, Core::Entity::Actor& targetActor ) override void onCastFinish( Core::Entity::Player& player, Core::Entity::Actor& targetActor ) override

View file

@ -12,7 +12,7 @@
class Aethernet : public EventScript class Aethernet : public EventScript
{ {
public: public:
Aethernet() : EventScript( "Aethernet", EVENTSCRIPT_AETHERNET_ID ) Aethernet() : EventScript( EVENTSCRIPT_AETHERNET_ID )
{} {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override

View file

@ -13,7 +13,7 @@
class Aetheryte : public EventScript class Aetheryte : public EventScript
{ {
public: public:
Aetheryte() : EventScript( "Aetheryte", EVENTSCRIPT_AETHERYTE_ID ) Aetheryte() : EventScript( EVENTSCRIPT_AETHERYTE_ID )
{} {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override

View file

@ -65,7 +65,7 @@ private:
} }
public: public:
OpeningGridania() : EventScript( "OpeningGridania", 1245186 ) OpeningGridania() : EventScript( 1245186 )
{} {}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override

View file

@ -81,7 +81,7 @@ private:
public: public:
OpeningLimsa() : EventScript( "OpeningLimsa", 1245185 ) {} OpeningLimsa() : EventScript( 1245185 ) {}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
{ {

View file

@ -65,7 +65,7 @@ private:
public: public:
OpeningUldah() : EventScript( "OpeningUldah", 1245187 ) {} OpeningUldah() : EventScript( 1245187 ) {}
void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override void onEnterZone( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2 ) override
{ {

View file

@ -90,7 +90,7 @@ private:
} }
public: public:
ManFst001() : EventScript( "ManFst001", 65575 ) {} ManFst001() : EventScript( 65575 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -189,7 +189,7 @@ private:
} }
public: public:
ManFst002() : EventScript( "ManFst002", 65621 ) {} ManFst002() : EventScript( 65621 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -12,7 +12,7 @@ private:
public: public:
ManFst003() : EventScript( "ManFst003", 65659 ) {} ManFst003() : EventScript( 65659 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -71,7 +71,7 @@ class ManFst004 : public EventScript
static constexpr auto UnlockDesion = 14; static constexpr auto UnlockDesion = 14;
public: public:
ManFst004() : EventScript( "Close to Home", 65660 ){}; ManFst004() : EventScript( 65660 ){};
~ManFst004(){}; ~ManFst004(){};
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View file

@ -145,7 +145,7 @@ private:
} }
public: public:
ManSea001() : EventScript( "ManSea001", 65643 ) {} ManSea001() : EventScript( 65643 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -136,7 +136,7 @@ private:
player.eventPlay( getId(), 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, callback ); player.eventPlay( getId(), 50, FADE_OUT | CONDITION_CUTSCENE | HIDE_UI, 0, 0, callback );
} }
public: public:
ManSea002() : EventScript( "ManSea002", 65644 ) {} ManSea002() : EventScript( 65644 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -129,7 +129,7 @@ private:
public: public:
ManWil001() : EventScript( "ManWil001", 66130 ) {} ManWil001() : EventScript( 66130 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -144,7 +144,7 @@ private:
public: public:
ManWil002() : EventScript( "ManWil002", 66104 ) { } ManWil002() : EventScript( 66104 ) { }
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -60,7 +60,7 @@ private:
public: public:
SubFst001() : EventScript( "SubFst001", 65560 ) {} SubFst001() : EventScript( 65560 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -1,76 +1,76 @@
#include "../../../ScriptObject.h" #include "../../../ScriptObject.h"
// Quest Script: SubFst002_00025 // Quest Script: SubFst002_00025
// Quest Name: Quarrels with Squirrels // Quest Name: Quarrels with Squirrels
// Quest ID: 65561 // Quest ID: 65561
// Start NPC: 1000263 // Start NPC: 1000263
// End NPC: 1000263 // End NPC: 1000263
class SubFst002 : public EventScript class SubFst002 : public EventScript
{ {
private: private:
static constexpr auto SEQ_0 = 0; static constexpr auto SEQ_0 = 0;
static constexpr auto SEQ_1 = 1; static constexpr auto SEQ_1 = 1;
static constexpr auto SEQ_2 = 2; static constexpr auto SEQ_2 = 2;
static constexpr auto SEQ_FINISH = 255; static constexpr auto SEQ_FINISH = 255;
static constexpr auto ACTOR0 = 1000263; static constexpr auto ACTOR0 = 1000263;
static constexpr auto ENEMY0 = 37; static constexpr auto ENEMY0 = 37;
static constexpr auto SEQ_0_ACTOR0 = 0; static constexpr auto SEQ_0_ACTOR0 = 0;
static constexpr auto SEQ_2_ACTOR0 = 1; static constexpr auto SEQ_2_ACTOR0 = 1;
void Scene00000( Entity::Player& player ) void Scene00000( Entity::Player& player )
{ {
auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{ {
if( param2 == 1 ) // accept quest if( param2 == 1 ) // accept quest
{ {
player.updateQuest( getId(), SEQ_1 ); player.updateQuest( getId(), SEQ_1 );
} }
}; };
player.eventPlay( getId (), 0, NONE, callback ); player.eventPlay( getId (), 0, NONE, callback );
} }
void Scene00001(Entity::Player& player) void Scene00001(Entity::Player& player)
{ {
auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 ) auto callback = [&]( Entity::Player& player, uint32_t eventId, uint16_t param1, uint16_t param2, uint16_t param3 )
{ {
if( param2 == 1 ) // finish quest if( param2 == 1 ) // finish quest
{ {
if( player.giveQuestRewards( getId(), 0 ) ) if( player.giveQuestRewards( getId(), 0 ) )
player.finishQuest( getId() ); player.finishQuest( getId() );
} }
}; };
player.eventPlay( getId(), 1, NONE, callback ); player.eventPlay( getId(), 1, NONE, callback );
} }
public: public:
SubFst002() : EventScript( "SubFst002", 65561 ) {} SubFst002() : EventScript( 65561 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {
auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) ); auto actor = Event::mapEventActorToRealActor( static_cast< uint32_t >( actorId ) );
if( actor == ACTOR0 && !player.hasQuest( getId() ) ) if( actor == ACTOR0 && !player.hasQuest( getId() ) )
Scene00000( player ); Scene00000( player );
else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH ) else if( actor == ACTOR0 && player.getQuestSeq( getId() ) == SEQ_FINISH )
Scene00001( player ); Scene00001( player );
} }
void onNpcKill( uint32_t npcId, Entity::Player& player ) override void onNpcKill( uint32_t npcId, Entity::Player& player ) override
{ {
if( npcId != ENEMY0 ) if( npcId != ENEMY0 )
return; return;
auto currentKC = player.getQuestUI8AL( getId() ) + 1; auto currentKC = player.getQuestUI8AL( getId() ) + 1;
if( currentKC >= 6 ) if( currentKC >= 6 )
player.updateQuest( getId(), SEQ_FINISH ); player.updateQuest( getId(), SEQ_FINISH );
else else
{ {
player.setQuestUI8AL( getId(), currentKC ); player.setQuestUI8AL( getId(), currentKC );
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 ); player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
} }
} }
}; };

View file

@ -42,7 +42,7 @@ private:
} }
public: public:
SubFst010() : EventScript( "SubFst010", 65537 ) {} SubFst010() : EventScript( 65537 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -148,7 +148,7 @@ private:
public: public:
SubFst013() : EventScript( "SubFst013", 65576 ) {} SubFst013() : EventScript( 65576 ) {}
void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override
{ {

View file

@ -24,22 +24,15 @@ using namespace Core;
class ScriptObject class ScriptObject
{ {
protected: protected:
std::string m_scriptName;
uint32_t m_id; uint32_t m_id;
std::size_t m_type; std::size_t m_type;
public: public:
ScriptObject( std::string name, uint32_t id, std::size_t type ) : ScriptObject( uint32_t id, std::size_t type ) :
m_scriptName( name ),
m_id( id ), m_id( id ),
m_type( type ) m_type( type )
{ } { }
virtual const std::string& getName() const
{
return m_scriptName;
}
virtual uint32_t getId() const virtual uint32_t getId() const
{ {
return m_id; return m_id;
@ -55,8 +48,8 @@ public:
class StatusEffectScript : public ScriptObject class StatusEffectScript : public ScriptObject
{ {
public: public:
StatusEffectScript( std::string name, uint32_t effectId ) : StatusEffectScript( uint32_t effectId ) :
ScriptObject( name, effectId, typeid( StatusEffectScript ).hash_code() ) ScriptObject( effectId, typeid( StatusEffectScript ).hash_code() )
{ } { }
virtual void onTick( Entity::Actor& actor ) { } virtual void onTick( Entity::Actor& actor ) { }
@ -73,8 +66,8 @@ public:
class ActionScript : public ScriptObject class ActionScript : public ScriptObject
{ {
public: public:
ActionScript( std::string name, uint32_t abilityId ) : ActionScript( uint32_t abilityId ) :
ScriptObject( name, abilityId, typeid( ActionScript ).hash_code() ) ScriptObject( abilityId, typeid( ActionScript ).hash_code() )
{ } { }
virtual void onStart( Entity::Actor& sourceActor, Entity::Actor& targetActor ) { } virtual void onStart( Entity::Actor& sourceActor, Entity::Actor& targetActor ) { }
@ -86,8 +79,8 @@ public:
class EventScript : public ScriptObject class EventScript : public ScriptObject
{ {
public: public:
EventScript( std::string name, uint32_t questId ) : EventScript( uint32_t questId ) :
ScriptObject( name, questId, typeid( EventScript ).hash_code() ) ScriptObject( questId, typeid( EventScript ).hash_code() )
{ } { }
virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) { } virtual void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) { }
@ -104,16 +97,16 @@ public:
class BattleNpcScript : public ScriptObject class BattleNpcScript : public ScriptObject
{ {
public: public:
BattleNpcScript( std::string name, uint32_t npcId ) : BattleNpcScript( uint32_t npcId ) :
ScriptObject( name, npcId, typeid( BattleNpcScript ).hash_code() ) ScriptObject( npcId, typeid( BattleNpcScript ).hash_code() )
{ } { }
}; };
class ZoneScript : public ScriptObject class ZoneScript : public ScriptObject
{ {
public: public:
ZoneScript( std::string name, uint32_t zoneId ) : ZoneScript( uint32_t zoneId ) :
ScriptObject( name, zoneId, typeid( ZoneScript ).hash_code() ) ScriptObject( zoneId, typeid( ZoneScript ).hash_code() )
{ } { }
virtual void onZoneInit() { } virtual void onZoneInit() { }