Merge branch 'atys' into develop-atys

feature/develop-atys
Nimetu 4 years ago
commit 040eee5c9e

@ -5522,7 +5522,7 @@ namespace NLGUI
string suri = elm.getAttribute("href"); string suri = elm.getAttribute("href");
if(suri.find("ah:") == 0) if(suri.find("ah:") == 0)
{ {
if (_TrustedDomain) if (_TrustedDomain || suri.find("ah:script:") == 0)
_Link.back() = suri; _Link.back() = suri;
} }
else else
@ -6386,11 +6386,13 @@ namespace NLGUI
void CGroupHTML::htmlOBJECTend(const CHtmlElement &elm) void CGroupHTML::htmlOBJECTend(const CHtmlElement &elm)
{ {
if (!_TrustedDomain)
return;
if (_ObjectType=="application/ryzom-data") if (_ObjectType=="application/ryzom-data")
{ {
if (!_TrustedDomain)
return;
if (!_ObjectData.empty()) if (!_ObjectData.empty())
{ {
if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript, _ObjectMD5Sum)) if (addBnpDownload(_ObjectData, _ObjectAction, _ObjectScript, _ObjectMD5Sum))
@ -6400,6 +6402,20 @@ namespace NLGUI
_ObjectScript.clear(); _ObjectScript.clear();
} }
} }
else if (_ObjectType=="application/ryzom-tutorial")
{
while(strFindReplace(_ObjectScript, "[", ""));
while(strFindReplace(_ObjectScript, "]", ""));
CLuaManager::getInstance().executeLuaScript("\ngame:executeTutorial([["+_ObjectScript+"]])\n", true);
_ObjectScript.clear();
}
else if (_ObjectType=="application/ryzom-script")
{
while(strFindReplace(_ObjectScript, "[", ""));
while(strFindReplace(_ObjectScript, "]", ""));
CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+_ObjectScript+"]])\n", true);
_ObjectScript.clear();
}
_Object = false; _Object = false;
} }

@ -326,8 +326,8 @@ CClientConfig::CClientConfig()
Local = false; // Default is Net Mode. Local = false; // Default is Net Mode.
FSHost = ""; // Default Host. FSHost = ""; // Default Host.
TexturesInterface.push_back("texture_interfaces_v3"); TexturesInterface.push_back("texture_interfaces_v3_2x");
TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc"); TexturesInterfaceDXTC.push_back("texture_interfaces_dxtc_2x");
TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui"); TexturesOutGameInterface.push_back("texture_interfaces_v3_outgame_ui");
@ -788,8 +788,8 @@ void CClientConfig::setValues()
READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC); READ_STRINGVECTOR_FV(TexturesOutGameInterfaceDXTC);
// interface textures ingame and r2 // interface textures ingame and r2
READ_STRINGVECTOR_FV(TexturesInterface); //READ_STRINGVECTOR_FV(TexturesInterface);
READ_STRINGVECTOR_FV(TexturesInterfaceDXTC); //READ_STRINGVECTOR_FV(TexturesInterfaceDXTC);
// interface files login menus // interface files login menus
READ_STRINGVECTOR_FV(XMLLoginInterfaceFiles); READ_STRINGVECTOR_FV(XMLLoginInterfaceFiles);

@ -4671,7 +4671,7 @@ class CHandlerOutgameNaviGetKeys : public IActionHandler
id = "sel"; id = "sel";
if (event != -1) if (event != -1)
- CLuaManager::getInstance().executeLuaScript(toString("outgame:eventChar%sKeyGet(%i)", id.c_str(), event)); CLuaManager::getInstance().executeLuaScript(toString("outgame:eventChar%sKeyGet(%i)", id.c_str(), event));
} }
// reset previous input // reset previous input
Driver->AsyncListener.reset(); Driver->AsyncListener.reset();

@ -86,6 +86,12 @@ void CBotChatManager::setCurrPage(CBotChatPage *page)
UserEntity->trader(CLFECOMMON::INVALID_SLOT); UserEntity->trader(CLFECOMMON::INVALID_SLOT);
} }
_CurrPage = page; _CurrPage = page;
if (page == NULL && !_AHAfterEnd.empty())
{
CAHManager::getInstance()->runActionHandler(_AHAfterEnd, NULL, "");
_AHAfterEnd = "";
}
} }
// ******************************************************************************************** // ********************************************************************************************

@ -93,12 +93,15 @@ public:
// Called for local client debugging // Called for local client debugging
void debugLocalReceiveMissionInfo(); void debugLocalReceiveMissionInfo();
void setAHAfterEnd(const std::string &ah) { _AHAfterEnd = ah ;}
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
private: private:
CBotChatPage *_CurrPage; CBotChatPage *_CurrPage;
uint16 _SessionID; uint16 _SessionID;
std::string _AHAfterEnd;
static CBotChatManager *_Instance; static CBotChatManager *_Instance;
//uint _ChosenMissionFlags; //uint _ChosenMissionFlags;

@ -161,6 +161,7 @@ void CBotChatPageMission::acceptMission()
/// close the botchat /// close the botchat
//CBotChatManager::getInstance()->setCurrPage(NULL); //CBotChatManager::getInstance()->setCurrPage(NULL);
_CurrSel = NULL; _CurrSel = NULL;
CBotChatManager::getInstance()->setAHAfterEnd("context_choose_mission");
} }

@ -51,6 +51,7 @@ private:
// an observer to update big mission list from littles pages in server database // an observer to update big mission list from littles pages in server database
CHugeListObs _MissionPagesObs; CHugeListObs _MissionPagesObs;
CDBCtrlSheet *_CurrSel; CDBCtrlSheet *_CurrSel;
bool _HaveAcceptedMission;
MISSION_DESC::TClientMissionType _MType; MISSION_DESC::TClientMissionType _MType;
}; };

@ -29,6 +29,7 @@
#include "nel/gui/action_handler.h" #include "nel/gui/action_handler.h"
#include "../entities.h" #include "../entities.h"
#include "nel/gui/group_paragraph.h" // For CCtrlLink #include "nel/gui/group_paragraph.h" // For CCtrlLink
#include "nel/gui/view_bitmap.h"
#include "../net_manager.h" #include "../net_manager.h"
#include "../string_manager_client.h" #include "../string_manager_client.h"
#include "../login.h" #include "../login.h"
@ -644,14 +645,42 @@ void CGroupInSceneBubbleManager::addMessagePopupCenter (const string &message, C
"ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size()); "ui:interface", templateParams.empty()?NULL:&(templateParams[0]), (uint)templateParams.size());
if (group) if (group)
{ {
ucstring finalMessage = message;
ucstring::size_type pos = message.find(ucstring("|"));
if (pos != std::string::npos)
{
CViewBitmap *pViewIcon = dynamic_cast<CViewBitmap*>(group->getView("iconA"));
if (pViewIcon != NULL)
{
string texture = message.substr(0, pos).toString();
pViewIcon->setTexture(texture);
}
ucstring::size_type end = message.find(ucstring("|"), pos+1);
if (end != std::string::npos)
{
CViewBitmap *pViewIcon = dynamic_cast<CViewBitmap*>(group->getView("iconZ"));
if (pViewIcon != NULL)
{
string texture = message.substr(end+1).toString();
pViewIcon->setTexture(texture);
}
finalMessage = message.substr(pos+1, end-pos-1);
}
else
finalMessage = message.substr(pos+1);
}
// Skill name // Skill name
CViewText *pViewName = dynamic_cast<CViewText*>(group->getView("name")); CViewText *pViewName = dynamic_cast<CViewText*>(group->getView("name"));
if (pViewName != NULL) if (pViewName != NULL)
{ {
pViewName->setTextFormatTaged(message); pViewName->setTextFormatTaged(finalMessage);
pViewName->setColor (color); pViewName->setColor (color);
} }
// Link to the interface // Link to the interface
CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group); CWidgetManager::getInstance()->addWindowToMasterGroup("ui:interface", group);
CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(CWidgetManager::getInstance()->getElementFromId("ui:interface")); CInterfaceGroup *pRoot = dynamic_cast<CInterfaceGroup*>(CWidgetManager::getInstance()->getElementFromId("ui:interface"));
@ -865,7 +894,7 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const std::string &ucsTe
textSize = endOfOriginal; textSize = endOfOriginal;
} }
} }
// Output the message in a bubble // Output the message in a bubble
bool show = false; bool show = false;

@ -75,6 +75,8 @@ bool CGroupQuickHelp::submitEvent (const char *event)
// Update the text // Update the text
updateParagraph (); updateParagraph ();
CLuaManager::getInstance().executeLuaScript(toString("\ngame:processTutorialEvent(\"%s\")\n", event), true);
} }
} }
return false; return false;

@ -2532,6 +2532,17 @@ void CInterfaceManager::displaySystemInfo(const string &str, const string &cat)
CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal; CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal;
CRGBA color = CRGBA::White; CRGBA color = CRGBA::White;
ucstring cleanStr = str;
ucstring::size_type pos = str.find(ucstring("|"));
if (pos != std::string::npos)
{
ucstring::size_type end = str.find(ucstring("|"), pos+1);
if (end != std::string::npos)
cleanStr = str.substr(pos+1, end-pos-1);
else
cleanStr = str.substr(pos+1);
}
// If broadcast, parse lua code // If broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A') if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A')
{ {
@ -2551,11 +2562,11 @@ void CInterfaceManager::displaySystemInfo(const string &str, const string &cat)
if (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around) if (mode != CClientConfig::SSysInfoParam::OverOnly && mode != CClientConfig::SSysInfoParam::Around)
{ {
if (PeopleInterraction.SystemInfo) if (PeopleInterraction.SystemInfo)
PeopleInterraction.ChatInput.SystemInfo.displayMessage(str, color, 2); PeopleInterraction.ChatInput.SystemInfo.displayMessage(cleanStr, color, 2);
else else
{ {
CPeopleInterraction::CSysMsg sysMsg; CPeopleInterraction::CSysMsg sysMsg;
sysMsg.Str = str; sysMsg.Str = cleanStr;
sysMsg.Cat = cat; sysMsg.Cat = cat;
PeopleInterraction.SystemMessageBuffer.push_back( sysMsg ); PeopleInterraction.SystemMessageBuffer.push_back( sysMsg );
} }
@ -2566,10 +2577,10 @@ void CInterfaceManager::displaySystemInfo(const string &str, const string &cat)
// If over popup a string at the bottom of the screen // If over popup a string at the bottom of the screen
if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly)) if ((mode == CClientConfig::SSysInfoParam::Over) || (mode == CClientConfig::SSysInfoParam::OverOnly))
InSceneBubbleManager.addMessagePopup(str, color); InSceneBubbleManager.addMessagePopup(cleanStr, color);
else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround) else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window) && PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2); PeopleInterraction.ChatInput.AroundMe.displayMessage(cleanStr, color, 2);
} }

@ -184,6 +184,21 @@ private:
REGISTER_ACTION_HANDLER(CHandlerLUA, "lua"); REGISTER_ACTION_HANDLER(CHandlerLUA, "lua");
std::deque<CRefPtr<CCtrlBase> > CHandlerLUA::_UICallerStack; std::deque<CRefPtr<CCtrlBase> > CHandlerLUA::_UICallerStack;
// ***************************************************************************
class CHandlerSCRIPT : public IActionHandler
{
public:
void execute(CCtrlBase *pCaller, const std::string &sParams)
{
string script = sParams;
while(strFindReplace(script, "[", ""));
while(strFindReplace(script, "]", ""));
strFindReplace(script, "|", "\n");
CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true);
}
};
REGISTER_ACTION_HANDLER(CHandlerSCRIPT, "script");
// *************************************************************************** // ***************************************************************************
// Allow also to call script from expression // Allow also to call script from expression
static DECLARE_INTERFACE_USER_FCT(lua) static DECLARE_INTERFACE_USER_FCT(lua)
@ -574,6 +589,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType), LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetShape), LUABIND_FUNC(getSheetShape),
LUABIND_FUNC(getCharacterSheetScale),
LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName), LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex), LUABIND_FUNC(getFameIndex),
@ -3622,7 +3638,15 @@ std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet)
return ""; return "";
} }
// ***************************************************************************
float CLuaIHMRyzom::getCharacterSheetScale(const std::string &sheet)
{
const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet));
const CCharacterSheet *charSheet = dynamic_cast<const CCharacterSheet*>(sheetPtr);
if (charSheet) return charSheet->Scale;
return 1;
}
// *************************************************************************** // ***************************************************************************
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet) std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
@ -4057,40 +4081,40 @@ sint32 CLuaIHMRyzom::getPlayerLevel()
// *************************************************************************** // ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpaHex() std::string CLuaIHMRyzom::getPlayerVpaHex()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpbHex() std::string CLuaIHMRyzom::getPlayerVpbHex()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
std::string CLuaIHMRyzom::getPlayerVpcHex() std::string CLuaIHMRyzom::getPlayerVpcHex()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getPlayerVpa() uint64 CLuaIHMRyzom::getPlayerVpa()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return prop; return prop;
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getPlayerVpb() uint64 CLuaIHMRyzom::getPlayerVpb()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop; return prop;
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getPlayerVpc() uint64 CLuaIHMRyzom::getPlayerVpc()
{ {
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
return prop; return prop;
@ -4152,8 +4176,8 @@ std::string CLuaIHMRyzom::getTargetVpaHex()
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
@ -4162,8 +4186,8 @@ std::string CLuaIHMRyzom::getTargetVpbHex()
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
@ -4172,40 +4196,37 @@ std::string CLuaIHMRyzom::getTargetVpcHex()
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
return NLMISC::toString("%X", prop); return NLMISC::toString("%" NL_I64 "X", prop);
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getTargetVpa() uint64 CLuaIHMRyzom::getTargetVpa()
{ {
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
return prop; return prop;
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getTargetVpb() uint64 CLuaIHMRyzom::getTargetVpb()
{ {
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
return prop; return prop;
} }
// *************************************************************************** // ***************************************************************************
sint64 CLuaIHMRyzom::getTargetVpc() uint64 CLuaIHMRyzom::getTargetVpc()
{ {
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
return prop; return prop;
} }

@ -235,6 +235,7 @@ private:
static bool isFullyPatched(); static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet); static std::string getSheetType(const std::string &sheet);
static std::string getSheetShape(const std::string &sheet); static std::string getSheetShape(const std::string &sheet);
static float getCharacterSheetScale(const std::string &sheet);
static std::string getSheetFamily(const std::string &sheet); static std::string getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId); static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName); static sint32 getFameIndex(const std::string &factionName);
@ -310,9 +311,9 @@ private:
static std::string getPlayerVpaHex(); static std::string getPlayerVpaHex();
static std::string getPlayerVpbHex(); static std::string getPlayerVpbHex();
static std::string getPlayerVpcHex(); static std::string getPlayerVpcHex();
static sint64 getPlayerVpa(); static uint64 getPlayerVpa();
static sint64 getPlayerVpb(); static uint64 getPlayerVpb();
static sint64 getPlayerVpc(); static uint64 getPlayerVpc();
static sint32 getTargetLevel(); // get current, precise level of the selected target, or -1 if there's no such selected target static sint32 getTargetLevel(); // get current, precise level of the selected target, or -1 if there's no such selected target
static sint32 getTargetForceRegion(); // get 'force region' for current target, or -1 if there's no selected target static sint32 getTargetForceRegion(); // get 'force region' for current target, or -1 if there's no selected target
static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target
@ -324,9 +325,9 @@ private:
static std::string getTargetVpaHex(); static std::string getTargetVpaHex();
static std::string getTargetVpbHex(); static std::string getTargetVpbHex();
static std::string getTargetVpcHex(); static std::string getTargetVpcHex();
static sint64 getTargetVpa(); static uint64 getTargetVpa();
static sint64 getTargetVpb(); static uint64 getTargetVpb();
static sint64 getTargetVpc(); static uint64 getTargetVpc();
static bool isTargetNPC(); // return 'true' if the target is an npc static bool isTargetNPC(); // return 'true' if the target is an npc
static bool isTargetPlayer(); // return 'true' if the target is a player static bool isTargetPlayer(); // return 'true' if the target is a player
static bool isTargetUser(); // return 'true' if the target is the user static bool isTargetUser(); // return 'true' if the target is the user

@ -534,7 +534,7 @@ void CStaticFames::loadTribeThreshold( const string& filename )
// check table structure // check table structure
uint nbTribe = ws.size()-2; uint nbTribe = ws.size()-2;
nlassert(nbTribe<=_FameTableSize); nlassert(nbTribe<=_FameTableSize);
nlassert(ws.ColCount == 16); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name nlassert(ws.ColCount == 17); // 5 ( 4 people + neutral ) * 3 cult + 1 for tribe name + marauder
_TribeCultThresholdPerCiv.resize(nbTribe); _TribeCultThresholdPerCiv.resize(nbTribe);
@ -548,7 +548,7 @@ void CStaticFames::loadTribeThreshold( const string& filename )
_TribeCultThresholdPerCiv[i-2].FameIndex = index; _TribeCultThresholdPerCiv[i-2].FameIndex = index;
for( uint c=1; c<ws.ColCount; c+=3) for( uint c=1; c<ws.ColCount-1; c+=3)
{ {
sint32 thresholdKami, thresholdKaravan, thresholdNeutral; sint32 thresholdKami, thresholdKaravan, thresholdNeutral;
fromString(ws.getData(i, c).toString(), thresholdKami); fromString(ws.getData(i, c).toString(), thresholdKami);
@ -585,6 +585,15 @@ void CStaticFames::loadTribeThreshold( const string& filename )
// This message removed by Sadge because there is no context displayed, meaning that message must be useless // This message removed by Sadge because there is no context displayed, meaning that message must be useless
// nldebug(" %s", ws.getData(i, c).toString().c_str() ); // nldebug(" %s", ws.getData(i, c).toString().c_str() );
} }
// Special case for Marauders
sint32 thresholdMarauder;
fromString(ws.getData(i, ws.ColCount-1).toString(), thresholdMarauder);
CTribeCultThreshold * tc;
tc = &_TribeCultThresholdPerCiv[i-2].Marauder;
tc->setMarauder(thresholdMarauder*6000);
} }
} }
} }

@ -52,26 +52,30 @@ public:
Kami = 0; Kami = 0;
Karavan = 0; Karavan = 0;
Neutral = 0; Neutral = 0;
Marauder = 0;
} }
void setKami(sint32 t) { Kami = t; } void setKami(sint32 t) { Kami = t; }
void setKaravan(sint32 t) { Karavan = t; } void setKaravan(sint32 t) { Karavan = t; }
void setNeutral(sint32 t) { Neutral = t; } void setNeutral(sint32 t) { Neutral = t; }
void setMarauder(sint32 t) { Marauder = t; }
sint32 getKami() const { return Kami; } sint32 getKami() const { return Kami; }
sint32 getKaravan() const { return Karavan; } sint32 getKaravan() const { return Karavan; }
sint32 getNeutral() const { return Neutral; } sint32 getNeutral() const { return Neutral; }
sint32 getMarauder() const { return Marauder; }
private: private:
sint32 Kami; sint32 Kami;
sint32 Karavan; sint32 Karavan;
sint32 Neutral; sint32 Neutral;
sint32 Marauder;
}; };
class CTribeCultThresholdPerCiv class CTribeCultThresholdPerCiv
{ {
public: public:
bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral) const bool getCultThresholdForCiv( PVP_CLAN::TPVPClan civ, sint32& kami, sint32& karavan, sint32& neutral, sint32& marauder) const
{ {
const CTribeCultThreshold * tc = 0; const CTribeCultThreshold * tc = 0;
switch( civ ) switch( civ )
@ -88,12 +92,16 @@ public:
case PVP_CLAN::Neutral: case PVP_CLAN::Neutral:
tc = &Neutral; tc = &Neutral;
break; break;
case PVP_CLAN::Marauder:
tc = &Marauder;
break;
default: default:
return false; return false;
} }
kami = tc->getKami(); kami = tc->getKami();
karavan = tc->getKaravan(); karavan = tc->getKaravan();
neutral = tc->getNeutral(); neutral = tc->getNeutral();
marauder = tc->getMarauder();
return true; return true;
} }
@ -103,6 +111,7 @@ public:
CTribeCultThreshold Tryker; CTribeCultThreshold Tryker;
CTribeCultThreshold Zorai; CTribeCultThreshold Zorai;
CTribeCultThreshold Neutral; CTribeCultThreshold Neutral;
CTribeCultThreshold Marauder;
}; };
// declare scoped constant value // declare scoped constant value

@ -136,6 +136,7 @@ namespace MAGICFX
OtherFireWall = 14, OtherFireWall = 14,
TeleportKami = 15, // No effect aura TeleportKami = 15, // No effect aura
TeleportKara = 16, // No effect aura TeleportKara = 16, // No effect aura
TeleportMarauder = 17, // No effect aura
}; };
} }

Loading…
Cancel
Save