mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-31 13:37:45 +00:00
Little rewrite
This commit is contained in:
parent
1071daef09
commit
ae736625d8
3 changed files with 44 additions and 45 deletions
|
@ -34,19 +34,19 @@ class SubFst005 : public EventScript
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SubFst005() : EventScript( 65564 )
|
SubFst005() : EventScript( 65564 )
|
||||||
{ };
|
{};
|
||||||
~SubFst005()
|
~SubFst005()
|
||||||
{ };
|
{};
|
||||||
|
|
||||||
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( actorId );
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
if ( actor == SubFst005::Actor0 )
|
if( actor == SubFst005::Actor0 )
|
||||||
{
|
{
|
||||||
Scene00000( player );
|
Scene00000( player );
|
||||||
}
|
}
|
||||||
else if ( actor == SubFst005::Actor1 )
|
else if( actor == SubFst005::Actor1 )
|
||||||
{
|
{
|
||||||
Scene00001( player );
|
Scene00001( player );
|
||||||
}
|
}
|
||||||
|
@ -56,25 +56,24 @@ class SubFst005 : public EventScript
|
||||||
|
|
||||||
void Scene00000( Entity::Player& player )
|
void Scene00000( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 0, 0,
|
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
player.updateQuest( m_id, 255 );
|
player.updateQuest( getId(), 255 );
|
||||||
});
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene00001( Entity::Player& player )
|
void Scene00001( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 1, 0,
|
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
if ( result.param2 == 1 )
|
if( result.param2 == 1 )
|
||||||
{
|
{
|
||||||
if ( player.giveQuestRewards( m_id, 0 ) )
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
player.finishQuest( m_id );
|
player.finishQuest( getId());
|
||||||
}
|
}
|
||||||
});
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,19 +39,19 @@ class SubFst039 : public EventScript
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SubFst039() : EventScript( 65732 )
|
SubFst039() : EventScript( 65732 )
|
||||||
{ };
|
{};
|
||||||
~SubFst039()
|
~SubFst039()
|
||||||
{ };
|
{};
|
||||||
|
|
||||||
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( actorId );
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
if ( actor == SubFst039::Actor0 && !player.hasQuest( m_id ) )
|
if( actor == SubFst039::Actor0 && !player.hasQuest( getId() ) )
|
||||||
{
|
{
|
||||||
Scene00000( player );
|
Scene00000( player );
|
||||||
}
|
}
|
||||||
if ( actor == SubFst039::Actor0 && player.getQuestSeq( m_id ) == 255 )
|
if( actor == SubFst039::Actor0 && player.getQuestSeq( getId() ) == 255 )
|
||||||
{
|
{
|
||||||
Scene00001( player );
|
Scene00001( player );
|
||||||
}
|
}
|
||||||
|
@ -59,17 +59,17 @@ class SubFst039 : public EventScript
|
||||||
|
|
||||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||||
{
|
{
|
||||||
if ( npcId != Enemy0 )
|
if( npcId != Enemy0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto currentKC = player.getQuestUI8AL( m_id ) + 1;
|
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||||
|
|
||||||
if ( currentKC >= 6 )
|
if ( currentKC >= 6 )
|
||||||
player.updateQuest( m_id, 255 );
|
player.updateQuest( getId(), 255 );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.setQuestUI8AL( m_id, currentKC );
|
player.setQuestUI8AL( getId(), currentKC );
|
||||||
player.sendQuestMessage( m_id, 0, 2, currentKC, 6 );
|
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,26 +77,26 @@ class SubFst039 : public EventScript
|
||||||
|
|
||||||
void Scene00000( Entity::Player& player )
|
void Scene00000( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 0, HIDE_HOTBAR,
|
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
if ( result.param2 == 1 )
|
if( result.param2 == 1 )
|
||||||
{
|
{
|
||||||
player.updateQuest( m_id, 1 );
|
player.updateQuest( getId(), 1 );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene00001( Entity::Player& player )
|
void Scene00001( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 1, HIDE_HOTBAR,
|
player.playScene( getId(), 1, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
if ( player.getQuestUI8AL( m_id ) == 1 )
|
if( player.getQuestUI8AL( getId() ) == 1 )
|
||||||
{
|
{
|
||||||
if ( player.giveQuestRewards( m_id, 0 ) )
|
if( player.giveQuestRewards( getId(), 0 ) )
|
||||||
{
|
{
|
||||||
player.finishQuest( m_id );
|
player.finishQuest( getId() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -38,19 +38,19 @@ class SubFst042 : public EventScript
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SubFst042() : EventScript( 65734 )
|
SubFst042() : EventScript( 65734 )
|
||||||
{ };
|
{};
|
||||||
~SubFst042()
|
~SubFst042()
|
||||||
{ };
|
{};
|
||||||
|
|
||||||
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( actorId );
|
auto actor = Event::mapEventActorToRealActor( actorId );
|
||||||
|
|
||||||
if ( actor == SubFst042::Actor0 && !player.hasQuest( m_id ) )
|
if ( actor == SubFst042::Actor0 && !player.hasQuest( getId() ) )
|
||||||
{
|
{
|
||||||
Scene00000( player );
|
Scene00000( player );
|
||||||
}
|
}
|
||||||
else if ( actor == SubFst042::Actor0 && player.getQuestSeq( m_id ) == SeqFinish )
|
else if ( actor == SubFst042::Actor0 && player.getQuestSeq( getId() ) == SeqFinish )
|
||||||
{
|
{
|
||||||
Scene00001( player );
|
Scene00001( player );
|
||||||
}
|
}
|
||||||
|
@ -58,17 +58,17 @@ class SubFst042 : public EventScript
|
||||||
|
|
||||||
void onMobKill( Entity::Player& player, uint64_t npcId )
|
void onMobKill( Entity::Player& player, uint64_t npcId )
|
||||||
{
|
{
|
||||||
if ( npcId != Enemy0 )
|
if( npcId != Enemy0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto currentKC = player.getQuestUI8AL( m_id ) + 1;
|
auto currentKC = player.getQuestUI8AL( getId() ) + 1;
|
||||||
|
|
||||||
if ( currentKC >= 6 )
|
if( currentKC >= 6 )
|
||||||
player.updateQuest( m_id, 255 );
|
player.updateQuest( getId(), 255 );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player.setQuestUI8AL( m_id, currentKC );
|
player.setQuestUI8AL( getId(), currentKC );
|
||||||
player.sendQuestMessage( m_id, 0, 2, currentKC, 6 );
|
player.sendQuestMessage( getId(), 0, 2, currentKC, 6 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,23 +76,23 @@ class SubFst042 : public EventScript
|
||||||
|
|
||||||
void Scene00000( Entity::Player& player )
|
void Scene00000( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 0, HIDE_HOTBAR,
|
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
if ( result.param2 == 1 )
|
if( result.param2 == 1 )
|
||||||
player.updateQuest( m_id, 1 );
|
player.updateQuest( getId(), 1 );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene00001( Entity::Player& player )
|
void Scene00001( Entity::Player& player )
|
||||||
{
|
{
|
||||||
player.playScene( m_id, 0, HIDE_HOTBAR,
|
player.playScene( getId(), 0, HIDE_HOTBAR,
|
||||||
[&]( Entity::Player& player, const Event::SceneResult& result )
|
[&]( Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
if ( result.param2 == 1 )
|
if ( result.param2 == 1 )
|
||||||
{
|
{
|
||||||
if ( player.giveQuestRewards( m_id, 0 ) )
|
if ( player.giveQuestRewards( getId(), 0 ) )
|
||||||
player.finishQuest( m_id );
|
player.finishQuest( getId() );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue