Merge branch 'main/gingo-test' into main/atys-live

main/atys-live live/895
Nuno 3 years ago
commit 3868876ab4

@ -4553,13 +4553,20 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
{ {
nlassert(targetHitDates.size()==bc.Targets.Targets.size()); nlassert(targetHitDates.size()==bc.Targets.Targets.size());
if(!bc.Targets.Targets.empty()) if (behaviour.DeltaHP == 0 || bc.Targets.Targets.empty())
return;
CRGBA deltaHPColor(0, 0, 0);
for (size_t i=0; i<bc.Targets.Targets.size(); ++i)
{ {
if(behaviour.DeltaHP != 0) if(bc.Targets.Targets[i].DeltaHP == 0)
continue;
CEntityCL *target2 = EntitiesMngr.entity(bc.Targets.Targets[i].TargetSlot);
if(target2)
{ {
CRGBA deltaHPColor(0, 0, 0);
// if it's a hit // if it's a hit
if( behaviour.DeltaHP < 0 ) if(bc.Targets.Targets[i].DeltaHP < 0)
{ {
// if the behaviour is casted by the user // if the behaviour is casted by the user
if( slot() == 0 ) if( slot() == 0 )
@ -4590,13 +4597,7 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
deltaHPColor = CRGBA(0,220,0); deltaHPColor = CRGBA(0,220,0);
} }
// Set the delta HP target2->addHPOutput(bc.Targets.Targets[i].DeltaHP, deltaHPColor, float(targetHitDates[i]-TimeInSec));
for (size_t i=0; i<bc.Targets.Targets.size(); ++i)
{
CEntityCL *target2 = EntitiesMngr.entity(bc.Targets.Targets[i].TargetSlot);
if(target2)
target2->addHPOutput(behaviour.DeltaHP, deltaHPColor, float(targetHitDates[i]-TimeInSec));
}
} }
} }
} }
@ -9705,7 +9706,7 @@ NLMISC_COMMAND(projectile, "Cast a projectile on another entity", "<spellID> <st
double dist = (target->pos() - ch->pos()).norm(); double dist = (target->pos() - ch->pos()).norm();
bool resist = false; bool resist = false;
if (args.size() > 4) fromString(args[4], resist); if (args.size() > 4) fromString(args[4], resist);
bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, resist, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, resist, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), -11));
} }
bc.BehavTime = TimeInSec; bc.BehavTime = TimeInSec;
ch->applyBehaviour(bc); ch->applyBehaviour(bc);
@ -9743,7 +9744,7 @@ NLMISC_COMMAND(mtProjectile, "Cast a projectile on one or several entities", "<c
if (mainTarget) if (mainTarget)
{ {
double dist = (mainTarget->pos() - ch->pos()).norm(); double dist = (mainTarget->pos() - ch->pos()).norm();
bc.Targets.Targets.push_back(CMultiTarget::CTarget(mainTargetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(mainTargetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), 1));
for(sint k = 1; k < (sint) (args.size() - 4); ++k) for(sint k = 1; k < (sint) (args.size() - 4); ++k)
{ {
uint secondaryTargetSlot; uint secondaryTargetSlot;
@ -9753,7 +9754,7 @@ NLMISC_COMMAND(mtProjectile, "Cast a projectile on one or several entities", "<c
if (secondaryTarget) if (secondaryTarget)
{ {
dist = (secondaryTarget->pos() - mainTarget->pos()).norm(); dist = (secondaryTarget->pos() - mainTarget->pos()).norm();
bc.Targets.Targets.push_back(CMultiTarget::CTarget(secondaryTargetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(secondaryTargetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), k+1));
} }
} }
} }
@ -9770,7 +9771,7 @@ NLMISC_COMMAND(mtProjectile, "Cast a projectile on one or several entities", "<c
if (target) if (target)
{ {
double dist = (target->pos() - ch->pos()).norm(); double dist = (target->pos() - ch->pos()).norm();
bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), k+1));
} }
} }
} }
@ -9787,7 +9788,7 @@ NLMISC_COMMAND(mtProjectile, "Cast a projectile on one or several entities", "<c
if (target) if (target)
{ {
double dist = (target->pos() - startSlot->pos()).norm(); double dist = (target->pos() - startSlot->pos()).norm();
bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), k+1));
startSlot = target; startSlot = target;
} }
} }
@ -10100,6 +10101,7 @@ NLMISC_COMMAND(attack, "simulate an attack", "<slot> <intensity> <hit_type> <loc
CMultiTarget::CTarget target; CMultiTarget::CTarget target;
target.TargetSlot = UserEntity->selection(); target.TargetSlot = UserEntity->selection();
target.Info = dsPower | (dsType << 3); target.Info = dsPower | (dsType << 3);
target.DeltaHP = -20;
bc.Targets.Targets.push_back(target); bc.Targets.Targets.push_back(target);
bc.BehavTime = TimeInSec; bc.BehavTime = TimeInSec;
bc.Behav.DeltaHP = -20; bc.Behav.DeltaHP = -20;
@ -10154,7 +10156,7 @@ NLMISC_COMMAND(rangeAttack, "simulate a range attack", "<slot> [intensity] [loca
CEntityCL *target = EntitiesMngr.entity(targetSlot); CEntityCL *target = EntitiesMngr.entity(targetSlot);
if (!target) return false; if (!target) return false;
double dist = (target->pos() - entity->pos()).norm(); double dist = (target->pos() - entity->pos()).norm();
bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), -10));
bc.Behav.DeltaHP = -10; bc.Behav.DeltaHP = -10;
entity->applyBehaviour(bc); entity->applyBehaviour(bc);
return true; return true;
@ -10188,7 +10190,7 @@ NLMISC_COMMAND(creatureAttack, "simulate a creature attack (2 attaques per creat
{ {
fromString(args[8], resist); fromString(args[8], resist);
} }
bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)))); bc.Targets.Targets.push_back(CMultiTarget::CTarget(targetSlot, false, (uint8) ceilf((float) (dist / MULTI_TARGET_DISTANCE_UNIT)), -15));
bc.Behav.CreatureAttack.ActionDuration = 0; bc.Behav.CreatureAttack.ActionDuration = 0;
uint magicImpactIntensity = 1; uint magicImpactIntensity = 1;
if (args.size() > 3) if (args.size() > 3)

@ -413,6 +413,7 @@ CClientConfig::CClientConfig()
CameraRecorderPrefix = "cam_rec"; CameraRecorderPrefix = "cam_rec";
CameraRecorderBlend = true; CameraRecorderBlend = true;
ScreenShotDirectory = "screenshots";
ScreenShotWidth = 0; ScreenShotWidth = 0;
ScreenShotHeight = 0; ScreenShotHeight = 0;
ScreenShotFullDetail = true; ScreenShotFullDetail = true;
@ -1142,6 +1143,7 @@ void CClientConfig::setValues()
READ_BOOL_FV(CameraRecorderBlend) READ_BOOL_FV(CameraRecorderBlend)
// Screenshot // Screenshot
READ_STRING_FV(ScreenShotDirectory)
READ_INT_FV(ScreenShotWidth) READ_INT_FV(ScreenShotWidth)
READ_INT_FV(ScreenShotHeight) READ_INT_FV(ScreenShotHeight)
READ_BOOL_FV(ScreenShotFullDetail) READ_BOOL_FV(ScreenShotFullDetail)

@ -306,6 +306,7 @@ struct CClientConfig
bool CameraRecorderBlend; bool CameraRecorderBlend;
/// Screen shot /// Screen shot
string ScreenShotDirectory;
uint ScreenShotWidth; // If 0 : normal screen shot, else custom screen shot without interface uint ScreenShotWidth; // If 0 : normal screen shot, else custom screen shot without interface
uint ScreenShotHeight; uint ScreenShotHeight;
bool ScreenShotFullDetail; // If set to true, then load balancing will be disabled for the duration of the screenshot bool ScreenShotFullDetail; // If set to true, then load balancing will be disabled for the duration of the screenshot

@ -408,6 +408,18 @@ NLMISC_COMMAND(afk, "Set the player as 'away from keyboard'","[<custom text>]")
return true; return true;
} }
NLMISC_COMMAND(selfkill, "Kill the player ","")
{
CBitMemStream out;
if(!GenericMsgHeaderMngr.pushNameToStream("COMMAND:SELFKILL", out))
{
nlwarning("Unknown message name COMMAND:SELFKILL");
return false;
}
NetMngr.push(out);
return true;
}
bool randomCheckCharset(std::string const& str) bool randomCheckCharset(std::string const& str)
{ {
std::string::const_iterator it, itEnd = str.end(); std::string::const_iterator it, itEnd = str.end();

@ -1095,6 +1095,20 @@ public:
REGISTER_ACTION_HANDLER( CHandlerContextWebPage, "context_web_page"); REGISTER_ACTION_HANDLER( CHandlerContextWebPage, "context_web_page");
// ***************************************************************************
class CHandlerFullMap : public IActionHandler
{
public:
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
{
CInterfaceManager *pIM= CInterfaceManager::getInstance();
CLuaManager::getInstance().executeLuaScript("game:openFullMap()", true);
}
};
REGISTER_ACTION_HANDLER( CHandlerFullMap, "fullmap");
// *************************************************************************** // ***************************************************************************

@ -562,7 +562,7 @@ static void openStackItem(CCtrlBase *pCaller, CDBCtrlSheet *pCSSrc, CDBCtrlSheet
//===================================================================================================================== //=====================================================================================================================
static void sendExchangeAddToServer(uint16 srcSlotIndex, uint16 destSlotIndex, uint16 quantitySrc) static void sendExchangeAddToServer(uint16 srcInvIndex, uint16 srcSlotIndex, uint16 destSlotIndex, uint16 quantitySrc)
{ {
CInterfaceManager *pIM= CInterfaceManager::getInstance(); CInterfaceManager *pIM= CInterfaceManager::getInstance();
@ -571,6 +571,7 @@ static void openStackItem(CCtrlBase *pCaller, CDBCtrlSheet *pCSSrc, CDBCtrlSheet
if(GenericMsgHeaderMngr.pushNameToStream(sMsg, out)) if(GenericMsgHeaderMngr.pushNameToStream(sMsg, out))
{ {
// Swap all the Src (quantity= quantitySrc) to dest // Swap all the Src (quantity= quantitySrc) to dest
out.serial(srcInvIndex);
out.serial(srcSlotIndex); out.serial(srcSlotIndex);
out.serial(destSlotIndex); out.serial(destSlotIndex);
out.serial(quantitySrc); out.serial(quantitySrc);
@ -615,7 +616,7 @@ static void openStackItem(CCtrlBase *pCaller, CDBCtrlSheet *pCSSrc, CDBCtrlSheet
NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:EXCHANGE:ACCEPTED")->setValue32(0); NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:EXCHANGE:ACCEPTED")->setValue32(0);
// send msg to server // send msg to server
sendExchangeAddToServer((uint16)src->getIndexInDB(), (uint8)dest->getIndexInDB(), (uint16)quantitySrc); sendExchangeAddToServer((uint16) src->getSecondIndexInDB(), (uint16)src->getIndexInDB(), (uint8)dest->getIndexInDB(), (uint16)quantitySrc);
} }
else else
{ {
@ -725,7 +726,7 @@ static void validateStackItem(CDBCtrlSheet *pCSSrc, CDBCtrlSheet *pCSDst, sint32
NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:EXCHANGE:ACCEPTED")->setValue32(0); NLGUI::CDBManager::getInstance()->getDbProp("LOCAL:EXCHANGE:ACCEPTED")->setValue32(0);
// send msg to server // send msg to server
sendExchangeAddToServer((uint16)pCSSrc->getIndexInDB(), (uint8)pCSDst->getIndexInDB(), (uint16)val); sendExchangeAddToServer((uint16)pCSSrc->getSecondIndexInDB(), (uint16)pCSSrc->getIndexInDB(), (uint8)pCSDst->getIndexInDB(), (uint16)val);
} }
} }
} }
@ -746,6 +747,10 @@ public:
CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src); CInterfaceElement *pElt = CWidgetManager::getInstance()->getElementFromId(src);
CDBCtrlSheet *pCSSrc = dynamic_cast<CDBCtrlSheet*>(pElt); CDBCtrlSheet *pCSSrc = dynamic_cast<CDBCtrlSheet*>(pElt);
CDBCtrlSheet *pCSDst = dynamic_cast<CDBCtrlSheet*>(pCaller); CDBCtrlSheet *pCSDst = dynamic_cast<CDBCtrlSheet*>(pCaller);
// end drag
getInventory().endDrag();
if ((pCSSrc == NULL) || (pCSDst == NULL)) return; if ((pCSSrc == NULL) || (pCSDst == NULL)) return;
if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item) if (pCSSrc->getType() == CCtrlSheetInfo::SheetType_Item)
@ -1049,9 +1054,21 @@ class CCanDropToExchange : public IActionHandler
if (!pCSSrc || !pCSDst) return; if (!pCSSrc || !pCSDst) return;
// Exchange can only be done from bag to exchange inventories // Exchange can only be done from bag to exchange inventories
uint32 srcInventory = pCSSrc->getSecondIndexInDB();
if (pCSSrc->getSecondIndexInDB() == INVENTORIES::bag && if (
pCSDst->getSecondIndexInDB() == INVENTORIES::exchange) (srcInventory == INVENTORIES::bag ||
srcInventory == INVENTORIES::pet_animal1 ||
srcInventory == INVENTORIES::pet_animal2 ||
srcInventory == INVENTORIES::pet_animal3 ||
srcInventory == INVENTORIES::pet_animal4 ||
srcInventory == INVENTORIES::pet_animal5 ||
srcInventory == INVENTORIES::pet_animal6 ||
srcInventory == INVENTORIES::pet_animal7 ||
srcInventory == INVENTORIES::guild ||
srcInventory == INVENTORIES::player_room)
&& getInventory().isInventoryAvailable((INVENTORIES::TInventory) pCSSrc->getSecondIndexInDB())
&& pCSDst->getSecondIndexInDB() == INVENTORIES::exchange
)
{ {
if (checkCanExchangeItem(pCSSrc)) if (checkCanExchangeItem(pCSSrc))
{ {
@ -1868,7 +1885,7 @@ class CHandlerItemMenuCheck : public IActionHandler
} }
if (pItemTextDisplay && pIS->Family == ITEMFAMILY::SCROLL) if (pItemTextDisplay && pIS->Family == ITEMFAMILY::SCROLL)
{ {
if (pCS->getInventoryIndex()==INVENTORIES::bag) if (pCS->getInventoryIndex()==INVENTORIES::bag && pIS->Scroll.Label.empty())
pItemTextDisplay->setActive(true); pItemTextDisplay->setActive(true);
pItemInfos->setActive(false); pItemInfos->setActive(false);
} }
@ -1960,16 +1977,15 @@ class CHandlerItemMenuCheck : public IActionHandler
for(i=0;i<MAX_INVENTORY_ANIMAL;i++) for(i=0;i<MAX_INVENTORY_ANIMAL;i++)
{ {
if (pMoveToPa[i]) if (pMoveToPa[i])
pMoveToPa[i]->setActive(invId!=INVENTORIES::guild && pMoveToPa[i]->setActive((uint)invId!=INVENTORIES::pet_animal+i &&
(uint)invId!=INVENTORIES::pet_animal+i &&
invMngr.isInventoryPresent((INVENTORIES::TInventory)(INVENTORIES::pet_animal+i)) ); invMngr.isInventoryPresent((INVENTORIES::TInventory)(INVENTORIES::pet_animal+i)) );
} }
if (pMoveToGuild) if (pMoveToGuild)
pMoveToGuild->setActive(invId==INVENTORIES::bag && invMngr.isInventoryPresent(INVENTORIES::guild)); pMoveToGuild->setActive(invId!=INVENTORIES::guild && invMngr.isInventoryPresent(INVENTORIES::guild));
if (pMoveToRoom) if (pMoveToRoom)
pMoveToRoom->setActive(invId==INVENTORIES::bag && invMngr.isInventoryPresent(INVENTORIES::player_room)); pMoveToRoom->setActive(invId!=INVENTORIES::player_room && invMngr.isInventoryPresent(INVENTORIES::player_room));
// std case: can drop / destroy // std case: can drop / destroy
if(pDrop) pDrop->setActive(invId!=INVENTORIES::guild); if(pDrop) pDrop->setActive(invId!=INVENTORIES::guild);
@ -2050,6 +2066,7 @@ class CHandlerItemMenuCheck : public IActionHandler
} }
// Only show lock menu item if inventory contains the info // Only show lock menu item if inventory contains the info
if (invId!=INVENTORIES::guild)
if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock()); if (pLockUnlock) pLockUnlock->setActive(pCS->canOwnerLock());

@ -62,9 +62,6 @@ extern NLMISC::CLog g_log;
//////////// ////////////
//static CCDBNodeLeaf *MenuColorWidgetValue = NULL; // db entry for the color menu widget (Red) //static CCDBNodeLeaf *MenuColorWidgetValue = NULL; // db entry for the color menu widget (Red)
static const string ScreenshotsDirectory("screenshots/"); // don't forget the final /
void preRenderNewSky (); void preRenderNewSky ();
// *************************************************************************** // ***************************************************************************
@ -602,11 +599,6 @@ void displayScreenShotSavedInfo(const string &filename)
pIM->displaySystemInfo(msg); pIM->displaySystemInfo(msg);
} }
void initScreenshot()
{
if (!CFile::isExists(ScreenshotsDirectory)) CFile::createDirectory(ScreenshotsDirectory);
}
bool screenshotZBuffer(const std::string &filename) bool screenshotZBuffer(const std::string &filename)
{ {
std::string::size_type pos = filename.find("."); std::string::size_type pos = filename.find(".");
@ -672,6 +664,11 @@ bool screenshotZBuffer(const std::string &filename)
static std::string findNewScreenShotFileName(std::string filename) static std::string findNewScreenShotFileName(std::string filename)
{ {
// make screenshot directory if it does not exist
if (!CFile::isExists(ClientCfg.ScreenShotDirectory))
CFile::createDirectory(ClientCfg.ScreenShotDirectory);
filename = CPath::standardizePath(ClientCfg.ScreenShotDirectory) + filename;
static char cstime[25]; static char cstime[25];
time_t dtime; time_t dtime;
time(&dtime); time(&dtime);
@ -698,7 +695,7 @@ void screenShotTGA()
CBitmap btm; CBitmap btm;
getBuffer (btm); getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.tga"); string filename = findNewScreenShotFileName("screenshot.tga");
COFile fs(filename); COFile fs(filename);
if (!btm.writeTGA(fs, 24, false)) if (!btm.writeTGA(fs, 24, false))
@ -720,7 +717,7 @@ void screenShotPNG()
CBitmap btm; CBitmap btm;
getBuffer (btm); getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.png"); string filename = findNewScreenShotFileName("screenshot.png");
COFile fs(filename); COFile fs(filename);
if (!btm.writePNG(fs, 24)) if (!btm.writePNG(fs, 24))
@ -742,7 +739,7 @@ void screenShotJPG()
CBitmap btm; CBitmap btm;
getBuffer (btm); getBuffer (btm);
string filename = findNewScreenShotFileName(ScreenshotsDirectory+"screenshot.jpg"); string filename = findNewScreenShotFileName("screenshot.jpg");
COFile fs(filename); COFile fs(filename);
if (!btm.writeJPG(fs)) if (!btm.writeJPG(fs))

@ -181,7 +181,6 @@ public:
/** Capture current content of framebuffer and save the result. If a custom size is asked in ClientCfg, then the scene is rendered again /** Capture current content of framebuffer and save the result. If a custom size is asked in ClientCfg, then the scene is rendered again
* instead (possibly multiple time) * instead (possibly multiple time)
*/ */
void initScreenshot();
void screenShotTGA(); void screenShotTGA();
void screenShotPNG(); void screenShotPNG();
void screenShotJPG(); void screenShotJPG();

@ -50,6 +50,10 @@ using namespace NLMISC;
// *************************************************************************** // ***************************************************************************
const std::string FaberPlanDB= "UI:PHRASE:FABER:FABER_PLAN:SHEET"; const std::string FaberPlanDB= "UI:PHRASE:FABER:FABER_PLAN:SHEET";
const std::string FaberPlanHpBuffDB= "UI:PHRASE:FABER:FABER_PLAN:HP_BUFF";
const std::string FaberPlanSapBuffDB= "UI:PHRASE:FABER:FABER_PLAN:SAP_BUFF";
const std::string FaberPlanStaBuffDB= "UI:PHRASE:FABER:FABER_PLAN:STA_BUFF";
const std::string FaberPlanFocusBuffDB= "UI:PHRASE:FABER:FABER_PLAN:FOCUS_BUFF";
const std::string MPFaberDB= "UI:PHRASE:FABER:MP_BUILD"; const std::string MPFaberDB= "UI:PHRASE:FABER:MP_BUILD";
const std::string MPSelectionDB= "UI:PHRASE:FABER:MP_SELECT"; const std::string MPSelectionDB= "UI:PHRASE:FABER:MP_SELECT";
const std::string MPQuantityDb= "UI:PHRASE:FABER:MP_QUANTITY"; const std::string MPQuantityDb= "UI:PHRASE:FABER:MP_QUANTITY";
@ -170,6 +174,16 @@ void CActionPhraseFaber::launchFaberCastWindow(sint32 memoryLine, uint memoryIn
if(node) if(node)
node->setValue32(0); node->setValue32(0);
// Reset buff values
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanHpBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanSapBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanStaBuffDB, false);
if (node) node->setValue32(0);
node = NLGUI::CDBManager::getInstance()->getDbProp(FaberPlanFocusBuffDB, false);
if (node) node->setValue32(0);
// Reset the result item // Reset the result item
node= NLGUI::CDBManager::getInstance()->getDbProp(ItemResultSheetDB, false); node= NLGUI::CDBManager::getInstance()->getDbProp(ItemResultSheetDB, false);
if(node) if(node)
@ -1565,6 +1579,14 @@ void CActionPhraseFaber::updateItemResult()
uint phraseSlot= pPM->getMemorizedPhrase(_ExecuteFromMemoryLine, _ExecuteFromMemoryIndex); uint phraseSlot= pPM->getMemorizedPhrase(_ExecuteFromMemoryLine, _ExecuteFromMemoryIndex);
const CSPhraseCom &phrase= pPM->getPhrase(phraseSlot); const CSPhraseCom &phrase= pPM->getPhrase(phraseSlot);
uint32 recommendedPropId= pBM->getBrickPropId("cr_recommended"); uint32 recommendedPropId= pBM->getBrickPropId("cr_recommended");
uint32 crHp = pBM->getBrickPropId("cr_hp");
uint32 crSap = pBM->getBrickPropId("cr_sap");
uint32 crSta = pBM->getBrickPropId("cr_sta");
uint32 crFocus = pBM->getBrickPropId("cr_focus");
sint32 hpBuff = 0;
sint32 sapBuff = 0;
sint32 staBuff = 0;
sint32 focusBuff = 0;
for(i=0;i<phrase.Bricks.size();i++) for(i=0;i<phrase.Bricks.size();i++)
{ {
CSBrickSheet *brick= pBM->getBrick(phrase.Bricks[i]); CSBrickSheet *brick= pBM->getBrick(phrase.Bricks[i]);
@ -1578,10 +1600,30 @@ void CActionPhraseFaber::updateItemResult()
// minimze the level // minimze the level
minLevel= min(minLevel, sint32(brick->Properties[j].Value)); minLevel= min(minLevel, sint32(brick->Properties[j].Value));
} }
if (brick->Properties[j].PropId == crHp)
hpBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crSap)
sapBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crSta)
staBuff = sint32(brick->Properties[j].Value);
if (brick->Properties[j].PropId == crFocus)
focusBuff = sint32(brick->Properties[j].Value);
} }
} }
} }
{
NLGUI::CDBManager *cdb = NLGUI::CDBManager::getInstance();
NLMISC::CCDBNodeLeaf *node = cdb->getDbProp(FaberPlanHpBuffDB, false);
if (node) node->setValue32(hpBuff);
node = cdb->getDbProp(FaberPlanSapBuffDB, false);
if (node) node->setValue32(sapBuff);
node = cdb->getDbProp(FaberPlanStaBuffDB, false);
if (node) node->setValue32(staBuff);
node = cdb->getDbProp(FaberPlanFocusBuffDB, false);
if (node) node->setValue32(focusBuff);
}
// **** Parse all MPs setuped, to compute level and stats // **** Parse all MPs setuped, to compute level and stats
uint totalItemPartMPReq= 0; uint totalItemPartMPReq= 0;

@ -2534,7 +2534,8 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
// there is max 4 icons // there is max 4 icons
sint32 hArea = (hSheet / 4); sint32 hArea = (hSheet / 4);
sint32 xIcon = x; sint32 xIcon = x;
sint32 yIcon = y; // move buff icons up a row, quantity text is displayed on bottom-left corner
sint32 yIcon = y + hArea;
for (uint i = 0; i < _BuffIcons.size(); ++i) for (uint i = 0; i < _BuffIcons.size(); ++i)
{ {
sint32 wIcon = _BuffIcons[i].IconW; sint32 wIcon = _BuffIcons[i].IconW;

@ -799,7 +799,11 @@ static DECLARE_INTERFACE_USER_FCT(getAnimalInventoryStateText)
// According to server status, change the inventory text // According to server status, change the inventory text
uint status= (uint)args[0].getInteger(); uint status= (uint)args[0].getInteger();
if(ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)status)) if(ANIMAL_STATUS::isInBag((ANIMAL_STATUS::EAnimalStatus)status))
{
result.setString("uiAnimalInBag");
}
else if(ANIMAL_STATUS::isInStable((ANIMAL_STATUS::EAnimalStatus)status))
{ {
result.setString("uiAnimalInStable"); result.setString("uiAnimalInStable");
} }

@ -2903,32 +2903,6 @@ class CHandlerInvCanDropTo : public IActionHandler
if ((pListDstText != NULL) || (pListDstIcon != NULL)) if ((pListDstText != NULL) || (pListDstIcon != NULL))
{ {
bool bCanDrop = true; bool bCanDrop = true;
// WE CANT DND if we want to dnd from other bag than BAG to guild bag
if (pListDstIcon != NULL)
{
if (pListDstIcon->getInvType() == CInventoryManager::InvGuild)
if (strnicmp(pCSSrc->getSheet().c_str(),"LOCAL:INVENTORY:BAG", 19) != 0)
bCanDrop = false;
}
if (pListDstText != NULL)
{
if (pListDstText->getInvType() == CInventoryManager::InvGuild)
if (strnicmp(pCSSrc->getSheet().c_str(),"LOCAL:INVENTORY:BAG", 19) != 0)
bCanDrop = false;
}
// WE CANT DND if we want to dnd from guild bag to other bag than BAG
if (pListDstIcon != NULL)
{
if (pListDstIcon->getInvType() != CInventoryManager::InvBag)
if (strnicmp(pCSSrc->getSheet().c_str(),"SERVER:GUILD:INVENTORY", 19) == 0)
bCanDrop = false;
}
if (pListDstText != NULL)
{
if (pListDstText->getInvType() != CInventoryManager::InvBag)
if (strnicmp(pCSSrc->getSheet().c_str(),"SERVER:GUILD:INVENTORY", 19) == 0)
bCanDrop = false;
}
// WE CANT DND when packer/mount is too far // WE CANT DND when packer/mount is too far
if (pListDstIcon != NULL) if (pListDstIcon != NULL)
@ -3100,7 +3074,6 @@ class CHandlerInvDropTo : public IActionHandler
else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvGuild)) || else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvGuild)) ||
((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvGuild))) ((pListDstIcon != NULL) && (pListDstIcon->getInvType() == CInventoryManager::InvGuild)))
{ {
if (strnicmp(pCSSrc->getSheet().c_str(), "LOCAL:INVENTORY:BAG", 19) == 0)
CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_guild"); CAHManager::getInstance()->runActionHandler("proc", pCSSrc, "move_to_guild");
} }
else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvRoom)) || else if (((pListDstText != NULL) && (pListDstText->getInvType() == CInventoryManager::InvRoom)) ||

@ -1000,9 +1000,6 @@ bool mainLoop()
// initialize the structure for the ping. // initialize the structure for the ping.
Ping.init(); Ping.init();
// initialize screenshots directory
initScreenshot();
// Call a function for a demo to init. // Call a function for a demo to init.
if (ClientCfg.Local) if (ClientCfg.Local)

@ -1681,6 +1681,18 @@ vector<string> CStringManagerClient::getTitleInfos(const string &titleId, bool w
{ {
if (titleId[0] != '#') if (titleId[0] != '#')
{ {
// Check special case like SON_OF|jane|joe (with SON_OF = "Son of {1} and {2}")
vector<string> titleReps;
splitString(listInfos[0], string("|"), titleReps);
if (titleReps.size() > 1)
{
listInfos[0] = getSpecialWord(titleReps[0], women);
for(uint i=1; i < titleReps.size(); ++i )
{
while(strFindReplace(listInfos[0], toString("{%d}", i), titleReps[i]));
}
}
else
listInfos[0] = getSpecialWord(listInfos[0], women); listInfos[0] = getSpecialWord(listInfos[0], women);
} }
} }

@ -491,8 +491,8 @@ void CUserEntity::updateVisualPropertyBehaviour(const NLMISC::TGameCycle &/* gam
} }
CCDBNodeLeaf *targetList0 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_0)); CCDBNodeLeaf *targetList0 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_0));
CCDBNodeLeaf *targetList1 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_1)); CCDBNodeLeaf *targetList1 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_1));
CCDBNodeLeaf *targetList2 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_1)); CCDBNodeLeaf *targetList2 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_2));
CCDBNodeLeaf *targetList3 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_1)); CCDBNodeLeaf *targetList3 = dynamic_cast<CCDBNodeLeaf *>(_DBEntry->getNode(CLFECOMMON::PROPERTY_TARGET_LIST_3));
if (targetList0 && targetList1 && targetList2 && targetList3) if (targetList0 && targetList1 && targetList2 && targetList3)
{ {
uint64 vp[4] = uint64 vp[4] =

@ -22,18 +22,16 @@
// *********************************************************************** // ***********************************************************************
void CMultiTarget::pack(uint64 *destVP, uint numVP) void CMultiTarget::pack(uint64 *destVP, uint numVP)
{ {
nlassert(numVP * 4 >= Targets.size()); // not enough room to stores visual properties! nlassert(numVP * 2 >= Targets.size()); // not enough room to stores visual properties!
CTarget invalidTarget; CTarget invalidTarget;
uint index = 0; uint index = 0;
for(uint k = 0; k < numVP; ++k) for(uint k = 0; k < numVP; ++k)
{ {
uint16 parts[4]; destVP[k] = index < Targets.size() ? Targets[index].getPacked() : invalidTarget.getPacked();
for(uint l = 0; l < 4; ++l) ++index;
{
parts[l] = index < Targets.size() ? Targets[index].getPacked() : invalidTarget.getPacked(); destVP[k] |= uint64(index < Targets.size() ? Targets[index].getPacked() : invalidTarget.getPacked()) << 32;
++ index; ++index;
}
destVP[k] = (uint64) parts[0] | ((uint64) parts[1] << 16) | ((uint64) parts[2] << 32) | ((uint64) parts[3] << 48);
} }
} }
@ -42,19 +40,16 @@ void CMultiTarget::unpack(const uint64 *srcVP, uint numVP)
{ {
Targets.clear(); Targets.clear();
for(uint k = 0; k < numVP; ++k) for(uint k = 0; k < numVP; ++k)
{
for(uint l = 0; l < 4; ++l)
{ {
CTarget t; CTarget t;
t.setPacked((uint16) ((srcVP[k] >> (16 * l)) & 0xffff)); t.setPacked(uint32(srcVP[k]));
if (t.TargetSlot != CLFECOMMON::INVALID_SLOT) if(t.TargetSlot == CLFECOMMON::INVALID_SLOT)
{ return;
Targets.push_back(t); Targets.push_back(t);
}
else t.setPacked(uint32(srcVP[k] >> 32));
{ if(t.TargetSlot == CLFECOMMON::INVALID_SLOT)
return; return;
} Targets.push_back(t);
}
} }
} }

@ -39,20 +39,21 @@ public:
uint8 TargetSlot; // the slot that is targetted uint8 TargetSlot; // the slot that is targetted
uint8 Info; // Damage shield for melee 5:3 format (damage shield io : power ) uint8 Info; // Damage shield for melee 5:3 format (damage shield io : power )
// Distance for range attacks (that do not have damage shield) format is 7:1 // Distance for range attacks (that do not have damage shield) format is 7:1
sint16 DeltaHP; //
public: public:
CTarget(uint8 slot = CLFECOMMON::INVALID_SLOT, bool resist = false, uint8 dist = 0) : TargetSlot(slot) CTarget(uint8 slot = CLFECOMMON::INVALID_SLOT, bool resist = false, uint8 dist = 0, sint16 deltaHp = 0) : TargetSlot(slot), DeltaHP(deltaHp)
{ {
Info = (resist == 0 ? 0 : 0x80) | (dist & 0x7f); Info = (resist == 0 ? 0 : 0x80) | (dist & 0x7f);
} }
uint16 getPacked() const; uint32 getPacked() const;
void setPacked(uint16 value); void setPacked(uint32 value);
}; };
typedef std::vector<CTarget> TTargetVect; typedef std::vector<CTarget> TTargetVect;
// the list of targets // the list of targets
TTargetVect Targets; TTargetVect Targets;
public: public:
/** create packed version of targets (to store in visual properties) /** create packed version of targets (to store in visual properties)
* each VP encodes 4 targets * each VP encodes 2 targets
* caller must provide enough room to store the result (assertion is raised otherwise) * caller must provide enough room to store the result (assertion is raised otherwise)
*/ */
void pack(uint64 *destVP, uint numVP); void pack(uint64 *destVP, uint numVP);
@ -65,19 +66,18 @@ public:
//////////// ////////////
// ******************************************************************************************* // *******************************************************************************************
inline uint16 CMultiTarget::CTarget::getPacked() const inline uint32 CMultiTarget::CTarget::getPacked() const
{ {
//return (uint16) TargetSlot | ((uint16) (Resist ? 1 : 0) << 15) | ((uint16) Distance << 8); //return (uint16) TargetSlot | ((uint16) (Resist ? 1 : 0) << 15) | ((uint16) Distance << 8);
return (uint16) TargetSlot | (uint16(Info) << 8); return ((uint32) TargetSlot) | ((uint32) Info << 8) | ((uint32) DeltaHP << 16);
} }
// ******************************************************************************************* // *******************************************************************************************
inline void CMultiTarget::CTarget::setPacked(uint16 value) inline void CMultiTarget::CTarget::setPacked(uint32 value)
{ {
TargetSlot = uint8(value & 0xff); TargetSlot = uint8(value);
/*Distance = (uint8) ((value >> 8) & 0x7f); Info = uint8(value >> 8);
Resist = (value & 0x8000) != 0;*/ DeltaHP = sint16(value >> 16);
Info = value >> 8;
} }
#endif #endif

Loading…
Cancel
Save