mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-30 11:46:24 +01:00
introduce premium account system as a real premmium account for donators while regular features like travling and spells are free
This commit is contained in:
@@ -140,6 +140,9 @@ bool BehaviourDatabase::loadConditions(ScriptReader& script, NpcBehaviour* behav
|
||||
} else if (identifier == "premium") {
|
||||
condition->type = BEHAVIOUR_TYPE_ISPREMIUM;
|
||||
searchTerm = true;
|
||||
} else if (identifier == "realpremium") {
|
||||
condition->type = BEHAVIOUR_TYPE_ISREALPREMIUM;
|
||||
searchTerm = true;
|
||||
} else if (identifier == "pvpenforced") {
|
||||
condition->type = BEHAVIOUR_TYPE_PVPENFORCED;
|
||||
searchTerm = true;
|
||||
@@ -801,6 +804,9 @@ bool BehaviourDatabase::checkCondition(const NpcBehaviourCondition* condition, P
|
||||
}
|
||||
break;
|
||||
case BEHAVIOUR_TYPE_ISPREMIUM:
|
||||
|
||||
break;
|
||||
case BEHAVIOUR_TYPE_ISREALPREMIUM:
|
||||
if (!player->isPremium()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ enum NpcBehaviourType_t
|
||||
BEHAVIOUR_TYPE_KNIGHT, // get/set vocation
|
||||
BEHAVIOUR_TYPE_PALADIN, // get/set vocation
|
||||
BEHAVIOUR_TYPE_ISPREMIUM, // is account premium
|
||||
BEHAVIOUR_TYPE_ISREALPREMIUM, // is REALLY account premium because many isPremium features are for free players also
|
||||
BEHAVIOUR_TYPE_PVPENFORCED, // get world type pvpenforced
|
||||
BEHAVIOUR_TYPE_MALE, // is player male
|
||||
BEHAVIOUR_TYPE_FEMALE, // is player female
|
||||
|
||||
@@ -329,7 +329,7 @@ ChatChannel* Chat::createChannel(const Player& player, uint16_t channelId)
|
||||
|
||||
case CHANNEL_PRIVATE: {
|
||||
//only 1 private channel for each premium player
|
||||
if (!player.isPremium() || getPrivateChannel(player)) {
|
||||
if (getPrivateChannel(player)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ ChannelList Chat::getChannelList(const Player& player)
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasPrivate && player.isPremium()) {
|
||||
if (!hasPrivate) {
|
||||
list.push_front(&dummyPrivate);
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -1725,7 +1725,7 @@ bool Game::playerBroadcastMessage(Player* player, const std::string& text) const
|
||||
void Game::playerCreatePrivateChannel(uint32_t playerId)
|
||||
{
|
||||
Player* player = getPlayerByID(playerId);
|
||||
if (!player || !player->isPremium()) {
|
||||
if (!player) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1852,7 +1852,7 @@ void ProtocolGame::sendOutfitWindow()
|
||||
|
||||
protocolOutfits.emplace_back(outfit.name, outfit.lookType, addons);
|
||||
if (CLIENT_VERSION_780 <= clientVersion && clientVersion <= CLIENT_VERSION_792) {
|
||||
if (protocolOutfits.size() == 15) { // Game client doesn't allow more than 15 outfits in 780-792
|
||||
if (protocolOutfits.size() == 20) { // Game client doesn't allow more than 15 outfits in 780-792
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user