mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 22:17:45 +00:00
Cleaner way to add gearsets
This commit is contained in:
parent
ae94aac979
commit
7524e39304
6 changed files with 21 additions and 7 deletions
|
@ -100,7 +100,7 @@ private:
|
||||||
{
|
{
|
||||||
player.finishQuest( getId() );
|
player.finishQuest( getId() );
|
||||||
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Archer );
|
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Archer );
|
||||||
player.setMaxGearSets( player.getMaxGearSets() + 1 );
|
player.addGearSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -101,7 +101,7 @@ private:
|
||||||
//TODO:Unlock gathering log? Maybe?
|
//TODO:Unlock gathering log? Maybe?
|
||||||
player.finishQuest( getId() );
|
player.finishQuest( getId() );
|
||||||
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Botanist );
|
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Botanist );
|
||||||
player.setMaxGearSets( player.getMaxGearSets() + 1 );
|
player.addGearSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -100,7 +100,7 @@ private:
|
||||||
//TODO:Unlock gathering log?
|
//TODO:Unlock gathering log?
|
||||||
player.finishQuest( getId() );
|
player.finishQuest( getId() );
|
||||||
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Miner );
|
player.setLevelForClass( 1, Sapphire::Common::ClassJob::Miner );
|
||||||
player.setMaxGearSets( player.getMaxGearSets() + 1 );
|
player.addGearSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,7 +214,7 @@ private:
|
||||||
{
|
{
|
||||||
//TODO: Unlock Skill
|
//TODO: Unlock Skill
|
||||||
player.finishQuest( getId() );
|
player.finishQuest( getId() );
|
||||||
player.setMaxGearSets( player.getMaxGearSets() + 1 );
|
player.addGearSet();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1227,14 +1227,25 @@ void Player::setAchievementData( const Player::AchievementData& achievementData
|
||||||
|
|
||||||
void Player::setMaxGearSets( uint8_t amount )
|
void Player::setMaxGearSets( uint8_t amount )
|
||||||
{
|
{
|
||||||
if( amount == 1 )
|
|
||||||
amount = 5;
|
|
||||||
|
|
||||||
m_equippedMannequin = amount;
|
m_equippedMannequin = amount;
|
||||||
|
|
||||||
queuePacket( makeActorControlSelf( getId(), SetMaxGearSets, m_equippedMannequin ) );
|
queuePacket( makeActorControlSelf( getId(), SetMaxGearSets, m_equippedMannequin ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::addGearSet()
|
||||||
|
{
|
||||||
|
uint8_t amount = 1;
|
||||||
|
|
||||||
|
if( getMaxGearSets() == 0 )
|
||||||
|
{
|
||||||
|
// unlock 5 gearsets the first time
|
||||||
|
amount = 5;
|
||||||
|
setRewardFlag( UnlockEntry::GearSets );
|
||||||
|
}
|
||||||
|
|
||||||
|
setMaxGearSets( getMaxGearSets() + amount );
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t Player::getMaxGearSets() const
|
uint8_t Player::getMaxGearSets() const
|
||||||
{
|
{
|
||||||
return m_equippedMannequin;
|
return m_equippedMannequin;
|
||||||
|
|
|
@ -387,6 +387,9 @@ namespace Sapphire::Entity
|
||||||
/*! set number of gear sets */
|
/*! set number of gear sets */
|
||||||
void setMaxGearSets( uint8_t amount );
|
void setMaxGearSets( uint8_t amount );
|
||||||
|
|
||||||
|
/*! add a gear set */
|
||||||
|
void addGearSet();
|
||||||
|
|
||||||
/*! get number of gear sets */
|
/*! get number of gear sets */
|
||||||
uint8_t getMaxGearSets() const;
|
uint8_t getMaxGearSets() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue