//---------------------------------------------------------------------------- void COutpostGuildDBUpdater::updateOutpostGuildDBOUTPOST_PROPERTIES() { CGuild* owner = CGuildManager::getInstance()->getGuildFromId(_Outpost->_OwnerGuildId); CGuild* attacker = CGuildManager::getInstance()->getGuildFromId(_Outpost->_AttackerGuildId); // uint32 const OWNED = (_Side == OUTPOSTENUMS::OutpostOwner)?1:0; // uint32 const SHEET = _Outpost->_Sheet.asInt(); // uint32 const LEVEL = _Outpost->getStaticForm()?_Outpost->getStaticForm()->Level:0; ucstring const GUILD_NAME = owner?owner->getName():ucstring(); uint64 const GUILD_ICON = owner?owner->getIcon():0; // uint32 const TRIBE = _Outpost->isBelongingToAGuild()?0:1; ucstring const GUILD_NAME_ATT = attacker?attacker->getName():ucstring(); // uint32 const STATUS = _Outpost->computeStatusForClient(); // uint32 const DISPLAY_CRASH = _Outpost->_CrashHappened?1:0; uint32 const WARCOST = _Outpost->_Form->ChallengeCost; uint32 const ROUND_LVL_THRESHOLD = _Outpost->_CurrentOutpostLevel; uint32 const ROUND_LVL_MAX_ATT = _Outpost->_FightData._MaxAttackLevel; uint32 const ROUND_LVL_MAX_DEF = _Outpost->_FightData._MaxDefenseLevel; uint32 const ROUND_LVL_CUR = _Outpost->_FightData._CurrentCombatLevel; uint32 const ROUND_ID_CUR = _Outpost->_FightData._CurrentCombatRound; uint32 const ROUND_ID_MAX = _Outpost->computeRoundCount(); uint32 const TIME_RANGE_DEF_WANTED = _Outpost->_DefenseHour; uint32 const TIME_RANGE_DEF = _Outpost->computeTimeRangeDefForClient(); uint32 const TIME_RANGE_ATT = _Outpost->computeTimeRangeAttForClient(); uint32 const TIME_RANGE_LENGTH = _Outpost->computeTimeRangeLengthForClient(); uint32 const SQUAD_CAPITAL = (_Side == OUTPOSTENUMS::OutpostOwner) ? _Outpost->_OwnerExpenseLimit : _Outpost->_AttackerExpenseLimit; setOWNED(_Side == OUTPOSTENUMS::OutpostOwner); setSHEET(_Outpost->_Sheet); setLEVEL(_Outpost->getStaticForm()?_Outpost->getStaticForm()->Level:0); setGUILD__NAME(GUILD_NAME); setGUILD__ICON(GUILD_ICON); setGUILD__TRIBE(!_Outpost->isBelongingToAGuild()); setGUILD__NAME_ATT(GUILD_NAME_ATT); setSTATUS(_Outpost->computeStatusForClient()); setDISPLAY_CRASH(_Outpost->_CrashHappened); setWARCOST(WARCOST); setROUND_LVL_THRESHOLD(uint8(ROUND_LVL_THRESHOLD)); setROUND_LVL_MAX_ATT(uint8(ROUND_LVL_MAX_ATT)); setROUND_LVL_MAX_DEF(uint8(ROUND_LVL_MAX_DEF)); setROUND_LVL_CUR(uint8(ROUND_LVL_CUR)); setROUND_ID_CUR(uint8(ROUND_ID_CUR)); setROUND_ID_MAX(uint8(ROUND_ID_MAX)); setTIME_RANGE_DEF_WANTED(uint8(TIME_RANGE_DEF_WANTED)); setTIME_RANGE_DEF(TIME_RANGE_DEF); setTIME_RANGE_ATT(TIME_RANGE_ATT); setTIME_RANGE_LENGTH(TIME_RANGE_LENGTH); setSQUAD_CAPITAL(SQUAD_CAPITAL); }
//---------------------------------------------------------------------------- void CBuildingPhysicalGuild::getClientDescription(uint16 roomIdx, uint16 ownerIndex, CCharacter * user, uint64 & icon, uint32 & textId )const { #ifdef NL_DEBUG nlassert(user); #endif CMirrorPropValueRO<TYPE_CELL> mirrorValue( TheDataset, user->getEntityRowId(), DSPropertyCELL ); const sint32 cell = mirrorValue; // if user is inside a building, icons and texts are found the same way as standard building if ( CBuildingManager::getInstance()->isRoomCell(cell) ) { icon = UINT64_CONSTANT(0x8000000000000000) + _Template->Rooms[roomIdx].Icon; textId = CZoneManager::getInstance().sendPlaceName( user->getEntityRowId(), _Template->Rooms[roomIdx].PhraseId ); } // otherwise, display the guild icon and guild name else { if ( ownerIndex >= _Guilds.size() ) { nlwarning("<BUILDING>%s ask for guild room %u count is %u, in building '%s'",ownerIndex, _Guilds.size(), user->getId().toString().c_str(),_Name.c_str()); textId = 0; icon = 0; return; } CGuild * guild = CGuildManager::getInstance()->getGuildFromId( _Guilds[ownerIndex] ); if ( !guild ) { nlwarning("<BUILDING>%s ask for guild %u. This guild is invalid",user->getId().toString().c_str(), _Guilds[ownerIndex] ); textId = 0; icon = 0; return; } icon = guild->getIcon(); static TVectorParamCheck params(1); params[0].Type = STRING_MANAGER::string_id; params[0].StringId = guild->getNameId(); textId = STRING_MANAGER::sendStringToClient( user->getEntityRowId(),"GUILD_ROOM",params ); } }