bool CInterShardExchangeValidator::isMoneyExchangeAllowed(TShardId shardId0, TShardId shardId1) const { // allow all exchanges between characters from the same shard if (shardId0==shardId1) return true; // don't allow money exchange between shards of different level caps if (getLevelCap(shardId0)!=getLevelCap(shardId1)) return false; // we've found no reason to refuse so return true return true; }
void CInstance::capPlayerToBCNM(){ //adjust player's level to the appropriate cap and remove buffs if(m_PlayerList.size()==0){ ShowWarning("instance:getPlayerMainLevel - No players in battlefield!\n"); return; } uint8 cap = getLevelCap(); if(cap != 0) { // Other missions lines and things like dragoon quest battle can be done similarly to CoP_Battle_cap. // Might be better to add a type flag to the sql to tell bcnm/isnm/which expantions mission than doing by bcnmID like this. if((map_config.CoP_Battle_cap == 0) && (m_BcnmID == 768 || m_BcnmID == 800 || m_BcnmID == 832 || m_BcnmID == 960 || m_BcnmID == 704 || m_BcnmID == 961 || m_BcnmID == 864 || m_BcnmID == 672 || m_BcnmID == 736 || m_BcnmID == 992)) { cap = 99; } if(cap < 99 && cap > 1) { cap = cap + map_config.Battle_cap_tweak; } if(cap > 99) { cap = 99; } if(cap < 1) { cap = 1; } for(int i=0; i<m_PlayerList.size(); i++) { m_PlayerList.at(i)->StatusEffectContainer->DelStatusEffectsByFlag(EFFECTFLAG_DISPELABLE); m_PlayerList.at(i)->StatusEffectContainer->DelStatusEffectsByFlag(EFFECTFLAG_ON_ZONE); m_PlayerList.at(i)->StatusEffectContainer->AddStatusEffect(new CStatusEffect(EFFECT_LEVEL_RESTRICTION,0,cap,0,0),true); } } }
bool CInterShardExchangeValidator::isExchangeAllowed(const CGameItemPtr& theItem, TShardId shardId0, TShardId shardId1) const { // allow all exchanges between characters from the same shard if (shardId0==shardId1) return true; // allow all exchanges of plot items if ( theItem->getStaticForm()->Family == ITEMFAMILY::SCROLL_R2 ) return true; // determine the maximum level for items exchanged between the 2 shards TLevelCap levelLimit= std::min(getLevelCap(shardId0),getLevelCap(shardId1)); // if item is too high level then refuse if (theItem->quality()>levelLimit) return false; // if item is flagged as non-shardExchangeable then refuse if (theItem->getStaticForm()->ShardExchangeable==false) return false; // if item is named (and not a plot item) then refuse if (!theItem->getPhraseId().empty()) return false; // we've found no reason to refuse so return true return true; }