1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 16:17:46 +00:00

sendEventNotice has been moved from player to eventMgr, reformatted scripts

This commit is contained in:
Mordred 2021-12-21 13:48:24 +01:00
parent d6dd81ad1b
commit 9f83094c43
33 changed files with 1386 additions and 1348 deletions

View file

@ -65,7 +65,7 @@ public:
if( result.numOfResults == 1 ) // set homepoint
{
player.setHomepoint( result.eventId & 0xFFFF );
player.sendEventNotice( result.eventId, 2, 0xEA, 0, 0 );
eventMgr().sendEventNotice( player, result.eventId, 2, 0xEA, 0, 0 );
}
else if( result.numOfResults == 2 ) // aethernet access
{
@ -96,11 +96,11 @@ public:
if( player.isActionLearned( Common::UnlockEntry::Teleport ) )
{
player.sendEventNotice( eventId, 0, 2, 0, 0 );
eventMgr().sendEventNotice( player, eventId, 0, 2, 0, 0 );
}
else
{
player.sendEventNotice( eventId, 0, 1, 1, 0 );
eventMgr().sendEventNotice( player, eventId, 0, 1, 1, 0 );
player.learnAction( Common::UnlockEntry::Teleport );
}
},

View file

@ -69,11 +69,11 @@ private:
void checkQuestCompletion( World::Quest& quest, Entity::Player& player, uint32_t varIdx )
{
if( varIdx == 3 )
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
else if( varIdx == 2 )
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
else
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
auto var_attuned = quest.getUI8AL();
auto var_class = quest.getUI8BH();
@ -199,7 +199,7 @@ public:
// attune
auto event = [ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );

View file

@ -59,7 +59,9 @@ private:
static constexpr auto UnlockDesion = 14;
public:
ManFst003() : Sapphire::ScriptAPI::QuestScript( 65659 ){};
ManFst003() : Sapphire::ScriptAPI::QuestScript( 65659 )
{};
~ManFst003() = default;
//////////////////////////////////////////////////////////////////////
@ -75,7 +77,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00051( quest, player );
@ -107,15 +109,15 @@ private:
if( varIdx == 3 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto QUEST_VAR_ATTUNE = quest.getUI8AL();

View file

@ -59,7 +59,9 @@ private:
static constexpr auto UnlockDesion = 14;
public:
ManFst004() : Sapphire::ScriptAPI::QuestScript( 65660 ){};
ManFst004() : Sapphire::ScriptAPI::QuestScript( 65660 )
{};
~ManFst004() = default;
//////////////////////////////////////////////////////////////////////
@ -78,7 +80,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00051( quest, player );
@ -104,15 +106,15 @@ private:
{
if( varIdx == 3 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto QUEST_VAR_ATTUNE = quest.getUI8AL();

View file

@ -56,7 +56,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00002( player );
@ -83,15 +83,15 @@ private:
{
if( varIdx == 1 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto pQuest = player.getQuest( getId() );

View file

@ -70,7 +70,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00002( player );
@ -97,15 +97,15 @@ private:
{
if( varIdx == 1 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto questId = getId();

View file

@ -88,7 +88,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00001( quest, player );
@ -103,15 +103,15 @@ private:
{
if( varIdx == 1 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto QUEST_VAR_ATTUNE = quest.getUI8AL();

View file

@ -88,7 +88,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00001( player );
@ -103,15 +103,15 @@ private:
{
if( varIdx == 1 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto pQuest = player.getQuest( getId() );

View file

@ -88,7 +88,7 @@ public:
eventMgr().eventActionStart( player, 0x050002, 0x13,
[ & ]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
player.sendEventNotice( 0x050002, 0, 1, 0, 0 );
eventMgr().sendEventNotice( player, 0x050002, 0, 1, 0, 0 );
player.registerAetheryte( 2 );
player.learnAction( Common::UnlockEntry::Return );
Scene00001( player );
@ -103,15 +103,15 @@ private:
{
if( varIdx == 1 )
{
player.sendEventNotice( getId(), 1, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 1, 0, 0, 0 );
}
else if( varIdx == 2 )
{
player.sendEventNotice( getId(), 2, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 2, 0, 0, 0 );
}
else
{
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
}
auto pQuest = player.getQuest( getId() );

View file

@ -147,7 +147,7 @@ class ClsArc004 : public Sapphire::ScriptAPI::QuestScript
[&]( Entity::Player& player, uint32_t eventId, uint64_t additional )
{
Scene00013( quest, player );
player.sendEventNotice(getId(), 2, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 2, 2, 0, 0 );
},
nullptr, 0);
break;
@ -173,7 +173,7 @@ class ClsArc004 : public Sapphire::ScriptAPI::QuestScript
{
auto currentCC = quest.getUI8AL();
player.sendEventNotice(getId(), 1, 2, currentCC + 1, 3);
eventMgr().sendEventNotice( player, getId(), 1, 2, currentCC + 1, 3 );
if( currentCC + 1 >= 3 )
{
@ -224,7 +224,7 @@ class ClsArc004 : public Sapphire::ScriptAPI::QuestScript
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
quest.setSeq( Seq2 );
}
@ -396,7 +396,8 @@ class ClsArc004 : public Sapphire::ScriptAPI::QuestScript
void Scene00016Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
if (result.getResult(0) == 1) {
if( result.getResult( 0) == 1 )
{
quest.setSeq( Seq5 );
auto& pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();
@ -426,7 +427,7 @@ class ClsArc004 : public Sapphire::ScriptAPI::QuestScript
void Scene00018Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
player.sendEventNotice(getId(), 4, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 4, 2, 0, 0 );
quest.setSeq( SeqFinish );
}

View file

@ -60,7 +60,9 @@ class ClsArc005 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Territorytype0 = 230;
public:
ClsArc005() : Sapphire::ScriptAPI::QuestScript( 65607 ){};
ClsArc005() : Sapphire::ScriptAPI::QuestScript( 65607 )
{};
~ClsArc005() = default;
//////////////////////////////////////////////////////////////////////
@ -114,7 +116,7 @@ class ClsArc005 : public Sapphire::ScriptAPI::QuestScript
[ & ]( Entity::Player &player, uint32_t eventId, uint64_t additional )
{
Scene00004( quest, player );
player.sendEventNotice(getId(), 2, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 2, 2, 0, 0 );
},
nullptr, 0 );
break;
@ -162,7 +164,7 @@ class ClsArc005 : public Sapphire::ScriptAPI::QuestScript
void Scene00002Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
{
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
quest.setSeq( Seq2 );
}
@ -175,7 +177,7 @@ class ClsArc005 : public Sapphire::ScriptAPI::QuestScript
void Scene00003Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
{
player.sendEventNotice(getId(), 1, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 1, 2, 0, 0 );
quest.setSeq( Seq3 );
}
@ -224,7 +226,8 @@ class ClsArc005 : public Sapphire::ScriptAPI::QuestScript
void Scene00007Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
{
if (result.getResult(0) == 1) {
if( result.getResult( 0 ) == 1 )
{
quest.setSeq( SeqFinish );
auto &pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref();

View file

@ -46,7 +46,9 @@ class SubFst004 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq2Actor2Npctradeok = 100;
public:
SubFst004() : Sapphire::ScriptAPI::QuestScript( 65563 ){};
SubFst004() : Sapphire::ScriptAPI::QuestScript( 65563 )
{};
~SubFst004() = default;
//////////////////////////////////////////////////////////////////////
@ -101,7 +103,7 @@ class SubFst004 : public Sapphire::ScriptAPI::QuestScript
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
player.sendEventNotice( getId(), 0, 2, 21002, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 21002, 0 );
quest.setUI8BH( 1 );
quest.setSeq( SeqFinish );
}

View file

@ -104,7 +104,7 @@ private:
void Scene00001Return( World::Quest &quest, Entity::Player &player, const Event::SceneResult &result )
{
quest.setUI8BH( 1 );
player.sendEventNotice( getId(), 0, 0, 0, 0 );
eventMgr().sendEventNotice( player, getId(), 0, 0, 0, 0 );
quest.setSeq( SeqFinish );
}

View file

@ -60,7 +60,9 @@ class SubFst013 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq6Actor0 = 6;
public:
SubFst013() : Sapphire::ScriptAPI::QuestScript( 65576 ){};
SubFst013() : Sapphire::ScriptAPI::QuestScript( 65576 )
{};
~SubFst013() = default;
//////////////////////////////////////////////////////////////////////
@ -218,7 +220,7 @@ class SubFst013 : public Sapphire::ScriptAPI::QuestScript
void Scene00096Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
player.sendEventNotice(getId(), 4, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 4, 2, 0, 0 );
}
//////////////////////////////////////////////////////////////////////
@ -267,7 +269,7 @@ class SubFst013 : public Sapphire::ScriptAPI::QuestScript
void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
}
};

View file

@ -47,7 +47,9 @@ class SubFst014 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Item0 = 2000084;
public:
SubFst014() : Sapphire::ScriptAPI::QuestScript( 65577 ){};
SubFst014() : Sapphire::ScriptAPI::QuestScript( 65577 )
{};
~SubFst014() = default;
//////////////////////////////////////////////////////////////////////
@ -135,7 +137,7 @@ class SubFst014 : public Sapphire::ScriptAPI::QuestScript
{
auto currentCC = quest.getUI8AL();
player.sendEventNotice(getId(), 0, 2, currentCC + 1, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, currentCC + 1, 6 );
quest.setUI8AL( currentCC + 1 );
quest.setUI8BH( currentCC + 1 );

View file

@ -45,7 +45,9 @@ class SubFst015 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto EventActionSearch = 1;
public:
SubFst015() : Sapphire::ScriptAPI::QuestScript( 65578 ){};
SubFst015() : Sapphire::ScriptAPI::QuestScript( 65578 )
{};
~SubFst015() = default;
//////////////////////////////////////////////////////////////////////
@ -133,7 +135,7 @@ class SubFst015 : public Sapphire::ScriptAPI::QuestScript
{
auto currentCC = quest.getUI8AL();
player.sendEventNotice(getId(), 0, 2, currentCC + 1, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, currentCC + 1, 6 );
if( currentCC + 1 >= 6 )
{

View file

@ -56,7 +56,9 @@ class SubFst030 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq4Actor0 = 4;
public:
SubFst030() : Sapphire::ScriptAPI::QuestScript( 65709 ){};
SubFst030() : Sapphire::ScriptAPI::QuestScript( 65709 )
{};
~SubFst030() = default;
//////////////////////////////////////////////////////////////////////
@ -125,7 +127,7 @@ class SubFst030 : public Sapphire::ScriptAPI::QuestScript
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
}
//////////////////////////////////////////////////////////////////////
@ -195,7 +197,7 @@ class SubFst030 : public Sapphire::ScriptAPI::QuestScript
void Scene00098Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
player.sendEventNotice(getId(), 2, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 2, 2, 0, 0 );
}
//////////////////////////////////////////////////////////////////////
@ -221,7 +223,7 @@ class SubFst030 : public Sapphire::ScriptAPI::QuestScript
void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq3 );
player.sendEventNotice(getId(), 1, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 1, 2, 0, 0 );
quest.setUI8FL( 1 );
quest.setUI8BH( 1 );
}

View file

@ -50,7 +50,9 @@ class SubFst043 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq2Actor1 = 3;
public:
SubFst043() : Sapphire::ScriptAPI::QuestScript( 65735 ){};
SubFst043() : Sapphire::ScriptAPI::QuestScript( 65735 )
{};
~SubFst043() = default;
//////////////////////////////////////////////////////////////////////
@ -102,13 +104,13 @@ class SubFst043 : public Sapphire::ScriptAPI::QuestScript
if( credit + 1 >= 2 )
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 2, credit + 1, 2);
eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 2 );
quest.setSeq( SeqFinish );
}
else
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 2, credit + 1, 2);
eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 2 );
}
}
//////////////////////////////////////////////////////////////////////

View file

@ -47,7 +47,9 @@ class SubFst046 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq2Actor0 = 4;
public:
SubFst046() : Sapphire::ScriptAPI::QuestScript( 65746 ){};
SubFst046() : Sapphire::ScriptAPI::QuestScript( 65746 )
{};
~SubFst046() = default;
//////////////////////////////////////////////////////////////////////
@ -92,13 +94,13 @@ class SubFst046 : public Sapphire::ScriptAPI::QuestScript
if( credit + 1 >= 3 )
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 0, credit + 1, 3);
eventMgr().sendEventNotice( player, getId(), 0, 0, credit + 1, 3 );
quest.setSeq( SeqFinish );
}
else
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 0, credit + 1, 3);
eventMgr().sendEventNotice( player, getId(), 0, 0, credit + 1, 3 );
}
}
//////////////////////////////////////////////////////////////////////

View file

@ -46,7 +46,9 @@ class SubFst048 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Seq2Actor0 = 4;
public:
SubFst048() : Sapphire::ScriptAPI::QuestScript( 65911 ){};
SubFst048() : Sapphire::ScriptAPI::QuestScript( 65911 )
{};
~SubFst048() = default;
//////////////////////////////////////////////////////////////////////
@ -90,13 +92,13 @@ class SubFst048 : public Sapphire::ScriptAPI::QuestScript
if( credit + 1 >= 3 )
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 2, credit + 1, 3);
eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 3 );
quest.setSeq( SeqFinish );
}
else
{
quest.setUI8AL( credit + 1 );
player.sendEventNotice(getId(), 0, 2, credit + 1, 3);
eventMgr().sendEventNotice( player, getId(), 0, 2, credit + 1, 3 );
}
}
//////////////////////////////////////////////////////////////////////

View file

@ -55,7 +55,9 @@ class SubSea001 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Territorytype0 = 129;
public:
SubSea001() : Sapphire::ScriptAPI::QuestScript( 65647 ){};
SubSea001() : Sapphire::ScriptAPI::QuestScript( 65647 )
{};
~SubSea001() = default;
//////////////////////////////////////////////////////////////////////
@ -156,7 +158,7 @@ class SubSea001 : public Sapphire::ScriptAPI::QuestScript
{
auto currentCC = quest.getUI8BH();
player.sendEventNotice(getId(), 1, 3, currentCC + 1, 6);
eventMgr().sendEventNotice( player, getId(), 1, 3, currentCC + 1, 6 );
if( currentCC + 1 >= 6 )
{

View file

@ -49,7 +49,9 @@ class SubWil004 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Item0 = 2000137;
public:
SubWil004() : Sapphire::ScriptAPI::QuestScript( 65689 ){};
SubWil004() : Sapphire::ScriptAPI::QuestScript( 65689 )
{};
~SubWil004() = default;
//////////////////////////////////////////////////////////////////////
@ -115,7 +117,7 @@ class SubWil004 : public Sapphire::ScriptAPI::QuestScript
auto currentCC = quest.getUI8AL();
auto currentQC = quest.getUI8BH();
player.sendEventNotice(getId(), 1, 3, currentCC + 1, 3);
eventMgr().sendEventNotice( player, getId(), 1, 3, currentCC + 1, 3 );
if( currentCC + 1 >= 3 )
{
@ -159,7 +161,7 @@ class SubWil004 : public Sapphire::ScriptAPI::QuestScript
void Scene00001Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
quest.setUI8BH( 3 );
}

View file

@ -41,7 +41,9 @@ class SubWil006 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Item0 = 2000201;
public:
SubWil006() : Sapphire::ScriptAPI::QuestScript( 65701 ){};
SubWil006() : Sapphire::ScriptAPI::QuestScript( 65701 )
{};
~SubWil006() = default;
//////////////////////////////////////////////////////////////////////
@ -113,7 +115,7 @@ class SubWil006 : public Sapphire::ScriptAPI::QuestScript
void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( SeqFinish );
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
}
//////////////////////////////////////////////////////////////////////

View file

@ -46,7 +46,9 @@ class SubWil007 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto FirstQuest = 66130;
public:
SubWil007() : Sapphire::ScriptAPI::QuestScript( 65703 ){};
SubWil007() : Sapphire::ScriptAPI::QuestScript( 65703 )
{};
~SubWil007() = default;
//////////////////////////////////////////////////////////////////////
@ -133,12 +135,12 @@ class SubWil007 : public Sapphire::ScriptAPI::QuestScript
if( currentQC >= 5 )
{
quest.setSeq( SeqFinish );
player.sendEventNotice(getId(), 1, 2, currentQC, 5);
eventMgr().sendEventNotice( player, getId(), 1, 2, currentQC, 5 );
}
else
{
quest.setUI8AL( currentQC );
player.sendEventNotice(getId(), 1, 2, currentQC, 5);
eventMgr().sendEventNotice( player, getId(), 1, 2, currentQC, 5 );
}
}
//////////////////////////////////////////////////////////////////////
@ -192,7 +194,7 @@ class SubWil007 : public Sapphire::ScriptAPI::QuestScript
void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
{
quest.setSeq( Seq2 );
player.sendEventNotice(getId(), 0, 1, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 1, 0, 0 );
}
//////////////////////////////////////////////////////////////////////

View file

@ -46,7 +46,9 @@ class SubWil018 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Item0 = 2000198;
public:
SubWil018() : Sapphire::ScriptAPI::QuestScript( 65932 ){};
SubWil018() : Sapphire::ScriptAPI::QuestScript( 65932 )
{};
~SubWil018() = default;
//////////////////////////////////////////////////////////////////////
@ -98,7 +100,7 @@ class SubWil018 : public Sapphire::ScriptAPI::QuestScript
{
auto currentCC = quest.getUI8AL();
player.sendEventNotice(getId(), 0, 3, currentCC + 1, 5);
eventMgr().sendEventNotice( player, getId(), 0, 3, currentCC + 1, 5 );
if( currentCC + 1 >= 5 )
{

View file

@ -50,7 +50,9 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Actor9 = 1001945;
public:
SubWil020() : Sapphire::ScriptAPI::QuestScript( 65929 ){};
SubWil020() : Sapphire::ScriptAPI::QuestScript( 65929 )
{};
~SubWil020() = default;
//////////////////////////////////////////////////////////////////////
@ -176,7 +178,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 1, true );
checkQuestProgression( quest, player );
}
@ -193,7 +195,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 2, true );
checkQuestProgression( quest, player );
}
@ -210,7 +212,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 3, true );
checkQuestProgression( quest, player );
}
@ -227,7 +229,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 4, true );
checkQuestProgression( quest, player );
}
@ -244,7 +246,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 5, true );
checkQuestProgression( quest, player );
}
@ -261,7 +263,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 6, true );
checkQuestProgression( quest, player );
}
@ -278,7 +280,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 7, true );
checkQuestProgression( quest, player );
}
@ -295,7 +297,7 @@ class SubWil020 : public Sapphire::ScriptAPI::QuestScript
auto hustCount = quest.getUI8AL();
hustCount += 1;
quest.setUI8AL( hustCount );
player.sendEventNotice(getId(), 0, 2, hustCount, 6);
eventMgr().sendEventNotice( player, getId(), 0, 2, hustCount, 6 );
quest.setBitFlag8( 8, true );
checkQuestProgression( quest, player );
}

View file

@ -41,7 +41,9 @@ class SubWil029 : public Sapphire::ScriptAPI::QuestScript
static constexpr auto Item0 = 2000410;
public:
SubWil029() : Sapphire::ScriptAPI::QuestScript( 65926 ){};
SubWil029() : Sapphire::ScriptAPI::QuestScript( 65926 )
{};
~SubWil029() = default;
//////////////////////////////////////////////////////////////////////
@ -98,7 +100,7 @@ class SubWil029 : public Sapphire::ScriptAPI::QuestScript
{
quest.setSeq( SeqFinish );
quest.setUI8BH( 1 );
player.sendEventNotice(getId(), 0, 2, 0, 0);
eventMgr().sendEventNotice( player, getId(), 0, 2, 0, 0 );
}
//////////////////////////////////////////////////////////////////////

View file

@ -582,9 +582,6 @@ namespace Sapphire::Entity
/*! send the entire inventory sequence */
void sendInventory();
/*! send a quest specific message */
void sendEventNotice( uint32_t questId, int8_t noticeId, uint8_t numOfArgs, uint32_t var1, uint32_t var2 );
/*! returns true if loading is complete ( 0x69 has been received ) */
bool isLoadingComplete() const;

View file

@ -142,12 +142,6 @@ void Sapphire::Entity::Player::addQuestTracking( uint8_t idx )
}
}
void
Sapphire::Entity::Player::sendEventNotice( uint32_t questId, int8_t noticeId, uint8_t numOfArgs, uint32_t var1, uint32_t var2 )
{
queuePacket( std::make_shared< Notice2Packet >( getAsPlayer(), questId, noticeId, numOfArgs, var1, var2 ) );
}
void Sapphire::Entity::Player::updateQuestsCompleted( uint32_t questId )
{
uint8_t index = questId / 8;

View file

@ -17,6 +17,7 @@
#include "Network/PacketWrappers/EventStartPacket.h"
#include "Network/PacketWrappers/EventPlayPacket.h"
#include "Network/PacketWrappers/EventFinishPacket.h"
#include "Network/PacketWrappers/Notice2Packet.h"
#include "Territory/Territory.h"
#include "Territory/InstanceContent.h"
@ -739,3 +740,10 @@ Sapphire::Event::EventHandlerPtr EventMgr::bootstrapSceneEvent( Entity::Player&
return pEvent;
}
void EventMgr::sendEventNotice( Entity::Player& player, uint32_t questId, int8_t noticeId, uint8_t numOfArgs, uint32_t var1, uint32_t var2 )
{
auto noticePacket = std::make_shared< Notice2Packet >( player.getId(), questId, noticeId, numOfArgs, var1, var2 );
auto& server = Common::Service< World::WorldServer >::ref();
server.queueForPlayer( player.getCharacterId(), noticePacket );
}

View file

@ -65,6 +65,8 @@ namespace Sapphire::World::Manager
bool sendEventPlay( Entity::Player& player, uint32_t eventid, uint32_t scene, uint32_t flags );
void sendEventNotice( Entity::Player& player, uint32_t eventId, int8_t noticeId, uint8_t numOfArgs = 0, uint32_t var1 = 0, uint32_t var2 = 0 );
/*! setup the event and return a ptr to it */
Event::EventHandlerPtr bootstrapSceneEvent( Entity::Player& player, uint32_t eventId, uint32_t flags );
};

View file

@ -2,7 +2,6 @@
#define _QUESTMESSAGE_H
#include <Network/GamePacket.h>
#include "Actor/Player.h"
#include "Forwards.h"
namespace Sapphire::Network::Packets::WorldPackets::Server
@ -14,20 +13,19 @@ namespace Sapphire::Network::Packets::WorldPackets::Server
class Notice2Packet : public ZoneChannelPacket< FFXIVIpcNotice2 >
{
public:
Notice2Packet( Entity::GameObjectPtr pActor, uint32_t questId, int8_t msgId,
uint8_t type = 0, uint32_t var1 = 0, uint32_t var2 = 0 ) :
ZoneChannelPacket< FFXIVIpcNotice2 >( pActor->getId(), pActor->getId() )
Notice2Packet( uint32_t entityId, uint32_t questId, int8_t msgId, uint8_t numOfArgs = 0, uint32_t var1 = 0, uint32_t var2 = 0 ) :
ZoneChannelPacket< FFXIVIpcNotice2 >( entityId, entityId )
{
initialize( questId, msgId, type, var1, var2 );
initialize( questId, msgId, numOfArgs, var1, var2 );
};
private:
void initialize( uint32_t questId, int8_t msgId, uint8_t type, uint32_t var1, uint32_t var2 )
void initialize( uint32_t questId, int8_t msgId, uint8_t numOfArgs, uint32_t var1, uint32_t var2 )
{
m_data.handlerId = questId;
m_data.noticeId = msgId;
// todo: not correct
m_data.numOfArgs = type;
m_data.numOfArgs = numOfArgs;
m_data.args[0] = var1;
m_data.args[1] = var2;
};

View file

@ -177,7 +177,8 @@ void Sapphire::QuestBattle::onFinishLoading( Entity::Player& player )
void Sapphire::QuestBattle::onInitDirector( Entity::Player& player )
{
player.sendEventNotice( getDirectorId(), 0, 2, Util::getTimeSeconds(), 0x0708 );
auto& eventMgr = Common::Service< World::Manager::EventMgr >::ref();
eventMgr.sendEventNotice( player, getDirectorId(), 0, 2, Util::getTimeSeconds(), 0x0708 );
sendDirectorVars( player );
player.setDirectorInitialized( true );
}