Merge branch 'ark'

feature/prepare-cross-merge
Ulukyn 5 years ago committed by kaetemi
parent 463738c036
commit 1c8a939797
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -711,8 +711,6 @@ void finalizeClientReady( uint32 userId, uint32 index )
if (c->invulnerableMode())
c->setBonusMalusName("invulnerability", c->addEffectInDB(CSheetId("invulnerability.sbrick"), true));
c->updateJewelsTags(false);
c->setFinalized(true);
} // finalizeClientReady //

@ -37,6 +37,7 @@
#include "team_manager/team_manager.h"
#include "weather_everywhere.h"
#include "death_penalties.h"
#include "harvest_source.h"
#include "mission_manager/mission_team.h"
#include "mission_manager/mission_step_ai.h"
#include "mission_manager/mission_guild.h"
@ -1039,6 +1040,7 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", "<uid> <slotname> <shee
if (itemPtr != NULL)
{
itemPtr->applyEnchantment(sheets);
c->updateJewelsTags(false);
log.displayNL("OK");
return true;
}
@ -4268,3 +4270,26 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", "<uid> <action>")
log.displayNL("OK");
return true;
}
NLMISC_COMMAND(despawnTargetSource, "Despawn the target source", "<uid>")
{
if (args.size() < 1) return false;
GET_ACTIVE_CHARACTER
const CEntityId &target = c->getTarget();
if (target.getType() == RYZOMID::forageSource)
{
TDataSetRow sourceRowId = c->getTargetDataSetRow();
CHarvestSource *source = CHarvestSourceManager::getInstance()->getEntity( sourceRowId );
if (!source->wasProspected())
{
source->spawnEnd(false);
log.displayNL("OK");
return true;
}
}
log.displayNL("ERR");
return true;
}

@ -89,6 +89,7 @@
#include "entities_game_service/egs_variables.h"
#include "entity_matrix.h"
#include "forage_progress.h"
#include "harvest_source.h"
#include "game_event_manager.h"
#include "game_item_manager/player_inv_pet.h"
#include "game_item_manager/player_inv_temp.h"
@ -14895,6 +14896,8 @@ string CCharacter::getTargetInfos()
msg += "n|";
else if (target.getType() == RYZOMID::player)
msg += "p|";
else if (target.getType() == RYZOMID::forageSource)
msg += "s|";
else
msg += "0";
@ -14932,6 +14935,21 @@ string CCharacter::getTargetInfos()
msg += toString("%.2f|%.2f|%.2f|%.2f|%.4f|%d|", dist, x, y, z, h, cell)+cTarget->getType().toString()+"|"+EGSPD::CPeople::toString(cTarget->getRace())+"|"+toString("%d", cTarget->getGender());
}
}
else if (target.getType() == RYZOMID::forageSource)
{
TDataSetRow sourceRowId = getTargetDataSetRow();
CHarvestSource *source = CHarvestSourceManager::getInstance()->getEntity( sourceRowId );
float x = source->pos().x;
float y = source->pos().y;
double dist = sqrt((p_x-x)*(p_x-x)+(p_y-y)*(p_y-y));
msg += toString("%.2f|%.2f|%.2f|", dist, x, y)+source->materialSheet().toString()+"|"+toString("%.2f|%.2f|%.2f|%u|", source->quantity(), source->quality(), source->maxQuality(), source->timeToLive());
if (source->wasProspected())
msg += "1";
else
msg += "0";
}
else
{
string name;
@ -17998,6 +18016,8 @@ void CCharacter::clearIgnoreList()
//--------------------------------------------------------------
void CCharacter::online(bool onlineStatus)
{
_AreOnline = onlineStatus;
// send contact list init if goind online
if (onlineStatus)
sendContactListInit();
@ -21196,9 +21216,9 @@ void CCharacter::updateParry(ITEMFAMILY::EItemFamily family, SKILLS::ESkills ski
}
//----------------------------------------------------------------------------
void CCharacter::updateJewelsTags(bool remove)
void CCharacter::updateJewelsTags(bool remove, bool update)
{
if (!getEnterFlag())
if (!getEnterFlag() || !getOnLineStatus())
return;
string tagA = getTagA();
@ -21222,9 +21242,13 @@ void CCharacter::updateJewelsTags(bool remove)
setTagB(sbrickParam->Value);
}
if (getTagA() != tagA || getTagB() != tagB)
if (!update)
return;
if (getTagA() != tagA || getTagB() != tagB) {
registerName();
}
}
//----------------------------------------------------------------------------
void CCharacter::updateMagicProtectionAndResistance()

@ -706,6 +706,12 @@ public:
*/
bool getEnterFlag() const;
/**
* Get the online status
* \return true if the player are in the game, false if he left
*/
bool getOnLineStatus() const;
/**
* wrapper to CEntityBase
*/
@ -2423,7 +2429,7 @@ public:
void updateParry(ITEMFAMILY::EItemFamily family, SKILLS::ESkills skill);
// Jewel enchants used for Tags
void updateJewelsTags(bool remove);
void updateJewelsTags(bool remove, bool update=true);
// Jewel equipment or skill or region are changed, recompute protection and resistances
void updateMagicProtectionAndResistance();
@ -3588,6 +3594,8 @@ private:
std::vector<SCheckPosCoordinate> _CheckPos;
bool _AreOnline;
// for a power/combat event, stores start and end ticks
struct CFlagTickRange
{

@ -82,6 +82,11 @@ inline bool CCharacter::getEnterFlag() const
return _Enter;
}
inline bool CCharacter::getOnLineStatus() const
{
return _AreOnline;
}
//------------------------------------------------------------------------------
//inline CEntityState& CCharacter::getState()

Loading…
Cancel
Save