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:
ErikasKontenis
2021-04-17 17:33:22 +03:00
parent 37aedf0555
commit 6fda4d4663
15 changed files with 78 additions and 95 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;
}
}