|
|
@ -151,7 +151,7 @@ void logMissionActionLaunch(uint32 line, CMission *m, const string &ActionNameAn
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!VerboseMissions) return;
|
|
|
|
if (!VerboseMissions) return;
|
|
|
|
string sTmp = "sline:" + toString(line) + " ";
|
|
|
|
string sTmp = "sline:" + toString(line) + " ";
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
m->getEntities( entities );
|
|
|
|
m->getEntities( entities );
|
|
|
|
for ( uint i = 0; i < entities.size(); i++)
|
|
|
|
for ( uint i = 0; i < entities.size(); i++)
|
|
|
@ -159,15 +159,15 @@ void logMissionActionLaunch(uint32 line, CMission *m, const string &ActionNameAn
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
sTmp += "user:" + pChar->getId().toString() + " ";
|
|
|
|
sTmp += "user:" + pChar->getId().toString() + " ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TAIAlias alias = m->getTemplateId();
|
|
|
|
TAIAlias alias = m->getTemplateId();
|
|
|
|
sTmp += "miss:" + CPrimitivesParser::aliasToString(alias);
|
|
|
|
sTmp += "miss:" + CPrimitivesParser::aliasToString(alias);
|
|
|
|
CMissionTemplate *templ = CMissionManager::getInstance()->getTemplate( alias );
|
|
|
|
CMissionTemplate *templ = CMissionManager::getInstance()->getTemplate( alias );
|
|
|
|
if (templ != NULL)
|
|
|
|
if (templ != NULL)
|
|
|
|
sTmp += ",'" + templ->getMissionName() + "' ";
|
|
|
|
sTmp += ",'" + templ->getMissionName() + "' ";
|
|
|
|
|
|
|
|
|
|
|
|
sTmp += "EXEC " + ActionNameAndParams;
|
|
|
|
sTmp += "EXEC " + ActionNameAndParams;
|
|
|
|
|
|
|
|
|
|
|
|
MISDBG("%s", sTmp.c_str());
|
|
|
|
MISDBG("%s", sTmp.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#define LOGMISSIONACTION(xxxx) logMissionActionLaunch(_SourceLine, instance, xxxx)
|
|
|
|
#define LOGMISSIONACTION(xxxx) logMissionActionLaunch(_SourceLine, instance, xxxx)
|
|
|
@ -255,7 +255,7 @@ static bool evaluateSDBExpr(const std::string &sdbExpr, double &res, bool ignore
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == sdbExpr.size() || varName.empty())
|
|
|
|
if (i == sdbExpr.size() || varName.empty())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
if (!CStatDB::getInstance()->valueGet(varName, varValue))
|
|
|
|
if (!CStatDB::getInstance()->valueGet(varName, varValue))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!ignoreUnknownVar)
|
|
|
|
if (!ignoreUnknownVar)
|
|
|
@ -301,7 +301,7 @@ protected:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return CMissionParser::solveTextsParams( _SourceLine, _Params, missionData );
|
|
|
|
return CMissionParser::solveTextsParams( _SourceLine, _Params, missionData );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string _Text;
|
|
|
|
string _Text;
|
|
|
|
TVectorParamCheck _Params;
|
|
|
|
TVectorParamCheck _Params;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -355,7 +355,7 @@ class CMissionActionBotChat :public CMissionActionText
|
|
|
|
// get speaking bot
|
|
|
|
// get speaking bot
|
|
|
|
if ( !CMissionParser::parseBotName(script[2],_Bot,missionData) )
|
|
|
|
if ( !CMissionParser::parseBotName(script[2],_Bot,missionData) )
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
return CMissionParser::parseParamText(line, script[3], _Text, _Params );
|
|
|
|
return CMissionParser::parseParamText(line, script[3], _Text, _Params );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -378,7 +378,7 @@ class CMissionActionBotChat :public CMissionActionText
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities( entities );
|
|
|
|
instance->getEntities( entities );
|
|
|
|
TVectorParamCheck params = _Params;
|
|
|
|
TVectorParamCheck params = _Params;
|
|
|
|
|
|
|
|
|
|
|
|
CMissionParser::solveBotNames(params,CAIAliasTranslator::getInstance()->getEntityId(instance->getGiver()));
|
|
|
|
CMissionParser::solveBotNames(params,CAIAliasTranslator::getInstance()->getEntityId(instance->getGiver()));
|
|
|
|
|
|
|
|
|
|
|
|
// 2 different loop : avoid multi test on chat type
|
|
|
|
// 2 different loop : avoid multi test on chat type
|
|
|
@ -401,7 +401,7 @@ class CMissionActionBotChat :public CMissionActionText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
TAIAlias _Bot;
|
|
|
|
TAIAlias _Bot;
|
|
|
|
CChatGroup::TGroupType _ChatMode;
|
|
|
|
CChatGroup::TGroupType _ChatMode;
|
|
|
|
|
|
|
|
|
|
|
@ -444,7 +444,7 @@ protected:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("popup_msg");
|
|
|
|
LOGMISSIONACTION("popup_msg");
|
|
|
@ -514,16 +514,16 @@ class CMissionActionSetDesc : public IMissionAction
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("set_desc");
|
|
|
|
LOGMISSIONACTION("set_desc");
|
|
|
|
instance->overrideDesc( _DescIndex );
|
|
|
|
instance->overrideDesc( _DescIndex );
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// index of this description in the template
|
|
|
|
// index of this description in the template
|
|
|
|
uint32 _DescIndex;
|
|
|
|
uint32 _DescIndex;
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionSetDesc)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionSetDesc)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionSetDesc,"set_desc");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionSetDesc,"set_desc");
|
|
|
@ -574,7 +574,7 @@ class CMissionActionRecvItem : public IMissionAction
|
|
|
|
ret = false;
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
missionData.ChatParams.push_back( make_pair( args[0], STRING_MANAGER::item ) );
|
|
|
|
missionData.ChatParams.push_back( make_pair( args[0], STRING_MANAGER::item ) );
|
|
|
|
|
|
|
|
|
|
|
|
_Quality = 1;
|
|
|
|
_Quality = 1;
|
|
|
|
if ( args.size() == 3 )
|
|
|
|
if ( args.size() == 3 )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -606,7 +606,7 @@ class CMissionActionRecvItem : public IMissionAction
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( _Quantity == 0 )
|
|
|
|
if ( _Quantity == 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MISLOGERROR("quantity = 0");
|
|
|
|
MISLOGERROR("quantity = 0");
|
|
|
@ -940,12 +940,12 @@ class CMissionActionRecvNamedItem : public IMissionAction
|
|
|
|
MISLOGERROR("bad named item format");
|
|
|
|
MISLOGERROR("bad named item format");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// read quantity
|
|
|
|
// read quantity
|
|
|
|
_Quantity = 1;
|
|
|
|
_Quantity = 1;
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
NLMISC::fromString(args[1], _Quantity);
|
|
|
|
NLMISC::fromString(args[1], _Quantity);
|
|
|
|
|
|
|
|
|
|
|
|
// read group
|
|
|
|
// read group
|
|
|
|
_Group = false;
|
|
|
|
_Group = false;
|
|
|
|
if ( script.size() == 3 )
|
|
|
|
if ( script.size() == 3 )
|
|
|
@ -1179,12 +1179,12 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
vector<string> args;
|
|
|
|
vector<string> args;
|
|
|
|
CMissionParser::tokenizeString( script[1]," \t",args );
|
|
|
|
CMissionParser::tokenizeString( script[1]," \t",args );
|
|
|
|
|
|
|
|
|
|
|
|
// read the quantity, or 1 by default
|
|
|
|
// read the quantity, or 1 by default
|
|
|
|
_Quantity = 1;
|
|
|
|
_Quantity = 1;
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
NLMISC::fromString(args[1], _Quantity);
|
|
|
|
NLMISC::fromString(args[1], _Quantity);
|
|
|
|
|
|
|
|
|
|
|
|
// If the name of the item macthes one of the special defined mission items for this mission
|
|
|
|
// If the name of the item macthes one of the special defined mission items for this mission
|
|
|
|
uint i = 0;
|
|
|
|
uint i = 0;
|
|
|
|
for (; i < missionData.Items.size(); i++ )
|
|
|
|
for (; i < missionData.Items.size(); i++ )
|
|
|
@ -1201,7 +1201,7 @@ public:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If no special mission item found, get a sheetid/quality
|
|
|
|
// If no special mission item found, get a sheetid/quality
|
|
|
|
if ( i == missionData.Items.size() )
|
|
|
|
if ( i == missionData.Items.size() )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1214,7 +1214,7 @@ public:
|
|
|
|
ret = false;
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
missionData.ChatParams.push_back( make_pair( args[0], STRING_MANAGER::item ) );
|
|
|
|
missionData.ChatParams.push_back( make_pair( args[0], STRING_MANAGER::item ) );
|
|
|
|
|
|
|
|
|
|
|
|
// read the minimum quality to destroy (1 if not specified)
|
|
|
|
// read the minimum quality to destroy (1 if not specified)
|
|
|
|
_Quality = 1;
|
|
|
|
_Quality = 1;
|
|
|
|
if ( args.size() == 3 )
|
|
|
|
if ( args.size() == 3 )
|
|
|
@ -1227,7 +1227,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Bad quantity?
|
|
|
|
// Bad quantity?
|
|
|
|
if ( _Quantity == 0 )
|
|
|
|
if ( _Quantity == 0 )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1243,10 +1243,10 @@ public:
|
|
|
|
uint16 _Quality;
|
|
|
|
uint16 _Quality;
|
|
|
|
uint16 _Quantity;
|
|
|
|
uint16 _Quantity;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// we destroy the item of the user in its inventory
|
|
|
|
/// we destroy the item of the user in its inventory
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
class CMissionActionDestroyItem :
|
|
|
|
class CMissionActionDestroyItem :
|
|
|
|
public IMissionAction,
|
|
|
|
public IMissionAction,
|
|
|
|
private CMissionBaseItemSelector
|
|
|
|
private CMissionBaseItemSelector
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1382,7 +1382,7 @@ MISSION_REGISTER_ACTION(CMissionActionDestroyItem,"destroy_item");
|
|
|
|
|
|
|
|
|
|
|
|
/// We test if the user has the requested item in its inventory
|
|
|
|
/// We test if the user has the requested item in its inventory
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class CMissionActionCondJumpIfItemInInv :
|
|
|
|
class CMissionActionCondJumpIfItemInInv :
|
|
|
|
public CMissionActionJump,
|
|
|
|
public CMissionActionJump,
|
|
|
|
private CMissionBaseItemSelector
|
|
|
|
private CMissionBaseItemSelector
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1395,10 +1395,10 @@ public:
|
|
|
|
MISLOGSYNTAXERROR("<item> [<quantity>] [<quality>]:<label>");
|
|
|
|
MISLOGSYNTAXERROR("<item> [<quantity>] [<quality>]:<label>");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Build the item filter
|
|
|
|
// Build the item filter
|
|
|
|
bool ret= CMissionBaseItemSelector::buildItemFilter(line, script, missionData);
|
|
|
|
bool ret= CMissionBaseItemSelector::buildItemFilter(line, script, missionData);
|
|
|
|
|
|
|
|
|
|
|
|
Label = CMissionParser::getNoBlankString(script[2]);
|
|
|
|
Label = CMissionParser::getNoBlankString(script[2]);
|
|
|
|
missionData.Jumps.push_back( Label );
|
|
|
|
missionData.Jumps.push_back( Label );
|
|
|
|
return ret;
|
|
|
|
return ret;
|
|
|
@ -1407,7 +1407,7 @@ public:
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("if_item_in_inv");
|
|
|
|
LOGMISSIONACTION("if_item_in_inv");
|
|
|
|
|
|
|
|
|
|
|
|
// For all entities affected by the mission
|
|
|
|
// For all entities affected by the mission
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
@ -1425,7 +1425,7 @@ public:
|
|
|
|
quantityDetected+= user->selectItems(INVENTORIES::bag, _SheetId, _Quality);
|
|
|
|
quantityDetected+= user->selectItems(INVENTORIES::bag, _SheetId, _Quality);
|
|
|
|
for(uint pa=0;pa<INVENTORIES::max_pet_animal;pa++)
|
|
|
|
for(uint pa=0;pa<INVENTORIES::max_pet_animal;pa++)
|
|
|
|
quantityDetected+= user->selectItems(INVENTORIES::TInventory(INVENTORIES::pet_animal + pa), _SheetId, _Quality);
|
|
|
|
quantityDetected+= user->selectItems(INVENTORIES::TInventory(INVENTORIES::pet_animal + pa), _SheetId, _Quality);
|
|
|
|
|
|
|
|
|
|
|
|
// if not enough requested items, fail!
|
|
|
|
// if not enough requested items, fail!
|
|
|
|
if(quantityDetected<_Quantity)
|
|
|
|
if(quantityDetected<_Quantity)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1435,7 +1435,7 @@ public:
|
|
|
|
// ok all palyer have the request in their bag!
|
|
|
|
// ok all palyer have the request in their bag!
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCondJumpIfItemInInv)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCondJumpIfItemInInv)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpIfItemInInv,"if_item_in_inv");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpIfItemInInv,"if_item_in_inv");
|
|
|
@ -1558,16 +1558,16 @@ class CMissionActionLearnAction : public IMissionAction
|
|
|
|
|
|
|
|
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_RECV_ACTION_%u", _ActionSheets.size()),
|
|
|
|
toString("MIS_RECV_ACTION_%u", _ActionSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
params.push_back(p);
|
|
|
|
params.push_back(p);
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_RECV_ACTION_NPC_%u", _ActionSheets.size()),
|
|
|
|
toString("MIS_RECV_ACTION_NPC_%u", _ActionSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1702,16 +1702,16 @@ class CMissionActionLearnBrick : public IMissionAction
|
|
|
|
|
|
|
|
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_RECV_BRICK_%u", _BrickSheets.size()),
|
|
|
|
toString("MIS_RECV_BRICK_%u", _BrickSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
params.push_back(p);
|
|
|
|
params.push_back(p);
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_RECV_BRICK_NPC_%u", _BrickSheets.size()),
|
|
|
|
toString("MIS_RECV_BRICK_NPC_%u", _BrickSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1846,16 +1846,16 @@ class CMissionActionUnlearnBrick : public IMissionAction
|
|
|
|
|
|
|
|
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
if (_Npc == CAIAliasTranslator::Invalid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_REMV_BRICK_%u", _BrickSheets.size()),
|
|
|
|
toString("MIS_REMV_BRICK_%u", _BrickSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
STRING_MANAGER::TParam p(STRING_MANAGER::bot, _Npc);
|
|
|
|
params.push_back(p);
|
|
|
|
params.push_back(p);
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
PHRASE_UTILITIES::sendDynamicSystemMessage(user->getEntityRowId(),
|
|
|
|
toString("MIS_REMV_BRICK_NPC_%u", _BrickSheets.size()),
|
|
|
|
toString("MIS_REMV_BRICK_NPC_%u", _BrickSheets.size()),
|
|
|
|
params);
|
|
|
|
params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1882,7 +1882,7 @@ class CMissionActionRecvMoney : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("<money> [: guild] OR <item><quality><factor> *[;<item><quality><factor>]");
|
|
|
|
MISLOGSYNTAXERROR("<money> [: guild] OR <item><quality><factor> *[;<item><quality><factor>]");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_Amount = 0;
|
|
|
|
_Amount = 0;
|
|
|
|
vector<string> multiArgs;
|
|
|
|
vector<string> multiArgs;
|
|
|
|
CMissionParser::tokenizeString( script[1],";",multiArgs );
|
|
|
|
CMissionParser::tokenizeString( script[1],";",multiArgs );
|
|
|
@ -2037,7 +2037,7 @@ class CMissionActionRecvFame : public IMissionAction
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2146,7 +2146,7 @@ class CMissionActionRecvXp : public IMissionAction
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
std::vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
// distribute XP among all entities
|
|
|
|
// distribute XP among all entities
|
|
|
|
for (uint32 i = 0; i < entities.size(); i++)
|
|
|
|
for (uint32 i = 0; i < entities.size(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2272,7 +2272,7 @@ class CMissionActionEmote : public IMissionAction
|
|
|
|
// get speaking bot
|
|
|
|
// get speaking bot
|
|
|
|
if ( !CMissionParser::parseBotName(vars[0],_Bot,missionData) )
|
|
|
|
if ( !CMissionParser::parseBotName(vars[0],_Bot,missionData) )
|
|
|
|
ret = false;
|
|
|
|
ret = false;
|
|
|
|
|
|
|
|
|
|
|
|
uint32 emoteId = 0;
|
|
|
|
uint32 emoteId = 0;
|
|
|
|
string sEmote = CMissionParser::getNoBlankString(vars[1]);
|
|
|
|
string sEmote = CMissionParser::getNoBlankString(vars[1]);
|
|
|
|
if ( !CMissionManager::getInstance()->getEmoteId(sEmote, emoteId) )
|
|
|
|
if ( !CMissionManager::getInstance()->getEmoteId(sEmote, emoteId) )
|
|
|
@ -2324,7 +2324,7 @@ class CMissionActionEmote : public IMissionAction
|
|
|
|
|
|
|
|
|
|
|
|
double dx = (double) ( user->getState().X - bot->getState().X );
|
|
|
|
double dx = (double) ( user->getState().X - bot->getState().X );
|
|
|
|
double dy = (double) ( user->getState().Y - bot->getState().Y );
|
|
|
|
double dy = (double) ( user->getState().Y - bot->getState().Y );
|
|
|
|
|
|
|
|
|
|
|
|
// send the heading to AI
|
|
|
|
// send the heading to AI
|
|
|
|
CSetBotHeadingMsg msg;
|
|
|
|
CSetBotHeadingMsg msg;
|
|
|
|
msg.BotRowId = bot->getEntityRowId();
|
|
|
|
msg.BotRowId = bot->getEntityRowId();
|
|
|
@ -2378,7 +2378,7 @@ IMissionAction* CMissionActionJump::getNewPtr()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CMissionActionJump * ptr = new CMissionActionJump;
|
|
|
|
CMissionActionJump * ptr = new CMissionActionJump;
|
|
|
|
*ptr = *this;
|
|
|
|
*ptr = *this;
|
|
|
|
return ptr;
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionJump,"jump");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionJump,"jump");
|
|
|
|
|
|
|
|
|
|
|
@ -2643,7 +2643,7 @@ class CMissionActionEnd : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("no param expected");
|
|
|
|
MISLOGSYNTAXERROR("no param expected");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
@ -2792,7 +2792,7 @@ class CMissionActionFailMissionCat : public IMissionAction
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// and the main mission template category
|
|
|
|
// and the main mission template category
|
|
|
|
if (!bFailed) // do not fail a mission twice
|
|
|
|
if (!bFailed) // do not fail a mission twice
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pMissTemplate = pMM->getTemplate(pMiss->getMainMissionTemplateId());
|
|
|
|
pMissTemplate = pMM->getTemplate(pMiss->getMainMissionTemplateId());
|
|
|
|
if (pMissTemplate != NULL)
|
|
|
|
if (pMissTemplate != NULL)
|
|
|
@ -2860,7 +2860,7 @@ class CMissionActionCompassNpc : public IMissionAction
|
|
|
|
sint32 y;
|
|
|
|
sint32 y;
|
|
|
|
string textName;
|
|
|
|
string textName;
|
|
|
|
c->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName);
|
|
|
|
c->getPositionCheck(toUpper(templ->getMissionName()), x, y, textName);
|
|
|
|
|
|
|
|
|
|
|
|
SM_STATIC_PARAMS_1(textParams, STRING_MANAGER::literal);
|
|
|
|
SM_STATIC_PARAMS_1(textParams, STRING_MANAGER::literal);
|
|
|
|
textParams[0].Literal.fromUtf8(textName);
|
|
|
|
textParams[0].Literal.fromUtf8(textName);
|
|
|
|
uint32 txtId = STRING_MANAGER::sendStringToClient( c->getEntityRowId(), "LITERAL", textParams );
|
|
|
|
uint32 txtId = STRING_MANAGER::sendStringToClient( c->getEntityRowId(), "LITERAL", textParams );
|
|
|
@ -2955,7 +2955,7 @@ class CMissionActionRemoveCompassNpc : public IMissionAction
|
|
|
|
alias = instance->getGiver();
|
|
|
|
alias = instance->getGiver();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
alias = Alias;
|
|
|
|
alias = Alias;
|
|
|
|
|
|
|
|
|
|
|
|
instance->removeCompassBot(alias);
|
|
|
|
instance->removeCompassBot(alias);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TAIAlias Alias;
|
|
|
|
TAIAlias Alias;
|
|
|
@ -3020,7 +3020,7 @@ class CMissionActionAIEvent : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("<group>;<event number>*[;<param>]");
|
|
|
|
MISLOGSYNTAXERROR("<group>;<event number>*[;<param>]");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string sGroup = CMissionParser::getNoBlankString(args[0]);
|
|
|
|
string sGroup = CMissionParser::getNoBlankString(args[0]);
|
|
|
|
CAIAliasTranslator::getInstance()->getGroupAliasesFromName(sGroup, Groups);
|
|
|
|
CAIAliasTranslator::getInstance()->getGroupAliasesFromName(sGroup, Groups);
|
|
|
|
if ( Groups.empty() )
|
|
|
|
if ( Groups.empty() )
|
|
|
@ -3060,7 +3060,7 @@ class CMissionActionAIEvent : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const CMissionTemplate * templ = CMissionManager::getInstance()->getTemplate( instance->getTemplateId() );
|
|
|
|
const CMissionTemplate * templ = CMissionManager::getInstance()->getTemplate( instance->getTemplateId() );
|
|
|
|
nlassert(templ);
|
|
|
|
nlassert(templ);
|
|
|
|
LOGMISSIONACTION("ai_event : can't send event '" + toString(EventId) + "' from mission '" +
|
|
|
|
LOGMISSIONACTION("ai_event : can't send event '" + toString(EventId) + "' from mission '" +
|
|
|
|
templ->getMissionName() + "' : mission giver invalid, can't retrieve AI instance");
|
|
|
|
templ->getMissionName() + "' : mission giver invalid, can't retrieve AI instance");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3112,7 +3112,7 @@ class CMissionActionDayPeriod : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("<hour> <min>; <hour> <min>");
|
|
|
|
MISLOGSYNTAXERROR("<hour> <min>; <hour> <min>");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vector<string> args;
|
|
|
|
vector<string> args;
|
|
|
|
splitString(script[1],";",args);
|
|
|
|
splitString(script[1],";",args);
|
|
|
|
if ( args.size() != 2)
|
|
|
|
if ( args.size() != 2)
|
|
|
@ -3120,7 +3120,7 @@ class CMissionActionDayPeriod : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("<hour> <min>; <hour> <min>");
|
|
|
|
MISLOGSYNTAXERROR("<hour> <min>; <hour> <min>");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
vector<string> params;
|
|
|
|
vector<string> params;
|
|
|
|
CMissionParser::tokenizeString(args[0]," \t",params);
|
|
|
|
CMissionParser::tokenizeString(args[0]," \t",params);
|
|
|
|
if ( params.size() != 2 )
|
|
|
|
if ( params.size() != 2 )
|
|
|
@ -3210,13 +3210,13 @@ class CMissionActionSeason : public IMissionAction
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("season");
|
|
|
|
LOGMISSIONACTION("season");
|
|
|
|
instance->setSeason(Season);
|
|
|
|
instance->setSeason(Season);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EGSPD::CSeason::TSeason Season;
|
|
|
|
EGSPD::CSeason::TSeason Season;
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionSeason)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionSeason)
|
|
|
@ -3239,7 +3239,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("reward");
|
|
|
|
LOGMISSIONACTION("reward");
|
|
|
@ -3285,11 +3285,11 @@ public:
|
|
|
|
bool ret = true;
|
|
|
|
bool ret = true;
|
|
|
|
vector<string> args;
|
|
|
|
vector<string> args;
|
|
|
|
CMissionParser::tokenizeString( script[1]," \t",args );
|
|
|
|
CMissionParser::tokenizeString( script[1]," \t",args );
|
|
|
|
|
|
|
|
|
|
|
|
uint16 quantity = 1;
|
|
|
|
uint16 quantity = 1;
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
if ( args.size() >= 2)
|
|
|
|
NLMISC::fromString(args[1], quantity);
|
|
|
|
NLMISC::fromString(args[1], quantity);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < items.size(); i++ )
|
|
|
|
for (uint i = 0; i < items.size(); i++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !nlstricmp( items[i].first , args[0] ) )
|
|
|
|
if ( !nlstricmp( items[i].first , args[0] ) )
|
|
|
@ -3303,14 +3303,14 @@ public:
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CSheetId sheet = CSheetId( CMissionParser::getNoBlankString(args[0]) + ".sitem" );
|
|
|
|
CSheetId sheet = CSheetId( CMissionParser::getNoBlankString(args[0]) + ".sitem" );
|
|
|
|
if ( sheet == CSheetId::Unknown )
|
|
|
|
if ( sheet == CSheetId::Unknown )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MISLOG("sline:%u syntax error sheetId '%s' is unknon", line, (CMissionParser::getNoBlankString(args[0]) + ".sitem").c_str() ) ;
|
|
|
|
MISLOG("sline:%u syntax error sheetId '%s' is unknon", line, (CMissionParser::getNoBlankString(args[0]) + ".sitem").c_str() ) ;
|
|
|
|
ret = false;
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uint16 quality = 1;
|
|
|
|
uint16 quality = 1;
|
|
|
|
if ( args.size() == 3 )
|
|
|
|
if ( args.size() == 3 )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3355,7 +3355,7 @@ public:
|
|
|
|
vector<CSheetId> Phrases;
|
|
|
|
vector<CSheetId> Phrases;
|
|
|
|
vector< pair<CMissionItem,uint16> > MissionItems;
|
|
|
|
vector< pair<CMissionItem,uint16> > MissionItems;
|
|
|
|
vector<CItemDesc> StdItems;
|
|
|
|
vector<CItemDesc> StdItems;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionRewardGroup)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionRewardGroup)
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -3468,7 +3468,7 @@ protected:
|
|
|
|
LOGMISSIONACTION("teleport : invalid tp index " + toString(DestinationIdx) + "TP is NULL");
|
|
|
|
LOGMISSIONACTION("teleport : invalid tp index " + toString(DestinationIdx) + "TP is NULL");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sint32 x,y,z;
|
|
|
|
sint32 x,y,z;
|
|
|
|
float heading;
|
|
|
|
float heading;
|
|
|
|
for ( uint i = 0; i < entities.size(); i++ )
|
|
|
|
for ( uint i = 0; i < entities.size(); i++ )
|
|
|
@ -3522,7 +3522,7 @@ protected:
|
|
|
|
LOGMISSIONACTION("teleport_x_y");
|
|
|
|
LOGMISSIONACTION("teleport_x_y");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities( entities );
|
|
|
|
instance->getEntities( entities );
|
|
|
|
|
|
|
|
|
|
|
|
for ( uint i = 0; i < entities.size(); i++ )
|
|
|
|
for ( uint i = 0; i < entities.size(); i++ )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter * user = PlayerManager.getChar( entities[i] );
|
|
|
|
CCharacter * user = PlayerManager.getChar( entities[i] );
|
|
|
@ -3805,7 +3805,7 @@ class CMissionActionGiveOutpostControl : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (guild->getOwnedCharge()->getOutpost() != op)
|
|
|
|
if (guild->getOwnedCharge()->getOutpost() != op)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlwarning("GiveOutpostControl : the guild '%s' is associated to outpost '%s', NOT to '%s'",
|
|
|
|
nlwarning("GiveOutpostControl : the guild '%s' is associated to outpost '%s', NOT to '%s'",
|
|
|
|
guild->getGuildName().toString().c_str(),
|
|
|
|
guild->getGuildName().toString().c_str(),
|
|
|
|
guild->getOwnedCharge()->getOutpost()->getName().c_str(),
|
|
|
|
guild->getOwnedCharge()->getOutpost()->getName().c_str(),
|
|
|
|
_OutpostName.c_str());
|
|
|
|
_OutpostName.c_str());
|
|
|
@ -4112,7 +4112,7 @@ class CMissionActionCancelOutside: public IMissionAction
|
|
|
|
CMissionManager::getInstance()->cleanPlaceConstraint( instance, Place );
|
|
|
|
CMissionManager::getInstance()->cleanPlaceConstraint( instance, Place );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
uint16 Place;
|
|
|
|
uint16 Place;
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCancelOutside)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCancelOutside)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCancelOutside,"cancel_outside");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCancelOutside,"cancel_outside");
|
|
|
@ -4122,7 +4122,7 @@ class CMissionActionSpawnMission: public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
TAIAlias Mission;
|
|
|
|
TAIAlias Mission;
|
|
|
|
TAIAlias NPCOwner; // NPC giver the mission have to be attached at spawn time
|
|
|
|
TAIAlias NPCOwner; // NPC giver the mission have to be attached at spawn time
|
|
|
|
bool Guild;
|
|
|
|
bool Guild;
|
|
|
|
|
|
|
|
|
|
|
@ -4143,7 +4143,7 @@ protected:
|
|
|
|
MISLOGERROR1("invalid mission '%s'", name.c_str());
|
|
|
|
MISLOGERROR1("invalid mission '%s'", name.c_str());
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Get the owner of the mission that will be spawn
|
|
|
|
// Get the owner of the mission that will be spawn
|
|
|
|
|
|
|
|
|
|
|
|
name = CMissionParser::getNoBlankString( script[2] );
|
|
|
|
name = CMissionParser::getNoBlankString( script[2] );
|
|
|
@ -4161,7 +4161,7 @@ protected:
|
|
|
|
MISLOG("sline:%u WARNING %s : name '%s' give multiple aliases", line, script[0].c_str(), name.c_str());
|
|
|
|
MISLOG("sline:%u WARNING %s : name '%s' give multiple aliases", line, script[0].c_str(), name.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NPCOwner = CAIAliasTranslator::Invalid;
|
|
|
|
NPCOwner = CAIAliasTranslator::Invalid;
|
|
|
|
if (vRet.size() > 0)
|
|
|
|
if (vRet.size() > 0)
|
|
|
|
NPCOwner = vRet[0];
|
|
|
|
NPCOwner = vRet[0];
|
|
|
@ -4186,6 +4186,8 @@ protected:
|
|
|
|
if (NPCOwner == CAIAliasTranslator::Invalid)
|
|
|
|
if (NPCOwner == CAIAliasTranslator::Invalid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(instance->getGiver(), sDebugBotName);
|
|
|
|
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(instance->getGiver(), sDebugBotName);
|
|
|
|
|
|
|
|
if (sDebugBotName.find('$') != string::npos)
|
|
|
|
|
|
|
|
sDebugBotName = sDebugBotName.substr(0, sDebugBotName.find('$'));
|
|
|
|
nlassert(instance);
|
|
|
|
nlassert(instance);
|
|
|
|
CMissionEventAddMission * event = new CMissionEventAddMission( instance->getGiver(), Mission, mainMission, Guild );
|
|
|
|
CMissionEventAddMission * event = new CMissionEventAddMission( instance->getGiver(), Mission, mainMission, Guild );
|
|
|
|
eventList.push_back( event );
|
|
|
|
eventList.push_back( event );
|
|
|
@ -4193,6 +4195,8 @@ protected:
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(NPCOwner, sDebugBotName);
|
|
|
|
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(NPCOwner, sDebugBotName);
|
|
|
|
|
|
|
|
if (sDebugBotName.find('$') != string::npos)
|
|
|
|
|
|
|
|
sDebugBotName = sDebugBotName.substr(0, sDebugBotName.find('$'));
|
|
|
|
CMissionEventAddMission * event = new CMissionEventAddMission( NPCOwner, Mission, mainMission, Guild );
|
|
|
|
CMissionEventAddMission * event = new CMissionEventAddMission( NPCOwner, Mission, mainMission, Guild );
|
|
|
|
eventList.push_back( event );
|
|
|
|
eventList.push_back( event );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -4251,9 +4255,9 @@ class CMissionActionEncycloUnlock : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint32 AlbumNb;
|
|
|
|
uint32 AlbumNb;
|
|
|
|
uint32 ThemaNb;
|
|
|
|
uint32 ThemaNb;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4270,7 +4274,7 @@ class CMissionActionEncycloUnlock : public IMissionAction
|
|
|
|
MISLOGSYNTAXERROR("<album> <thema>");
|
|
|
|
MISLOGSYNTAXERROR("<album> <thema>");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NLMISC::fromString(vars[0], AlbumNb);
|
|
|
|
NLMISC::fromString(vars[0], AlbumNb);
|
|
|
|
NLMISC::fromString(vars[1], ThemaNb);
|
|
|
|
NLMISC::fromString(vars[1], ThemaNb);
|
|
|
|
|
|
|
|
|
|
|
@ -4304,8 +4308,8 @@ MISSION_REGISTER_ACTION(CMissionActionEncycloUnlock,"encyclo_unlock");
|
|
|
|
class CMissionActionGameEventSubscribe : public IMissionAction
|
|
|
|
class CMissionActionGameEventSubscribe : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4318,7 +4322,7 @@ class CMissionActionGameEventSubscribe : public IMissionAction
|
|
|
|
LOGMISSIONACTION("game_event_subscribe");
|
|
|
|
LOGMISSIONACTION("game_event_subscribe");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -4339,8 +4343,8 @@ MISSION_REGISTER_ACTION(CMissionActionGameEventSubscribe,"game_event_subscribe")
|
|
|
|
class CMissionActionGameEventReset : public IMissionAction
|
|
|
|
class CMissionActionGameEventReset : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4353,7 +4357,7 @@ class CMissionActionGameEventReset : public IMissionAction
|
|
|
|
LOGMISSIONACTION("game_event_reset");
|
|
|
|
LOGMISSIONACTION("game_event_reset");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -4375,8 +4379,8 @@ class CMissionActionSetEventFaction : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string EventFaction;
|
|
|
|
string EventFaction;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4418,8 +4422,8 @@ class CMissionActionSetRespawnPoints : public IMissionAction
|
|
|
|
vector<uint16> _RespawnPoints;
|
|
|
|
vector<uint16> _RespawnPoints;
|
|
|
|
bool _HideOthers;
|
|
|
|
bool _HideOthers;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4493,7 +4497,7 @@ class CMissionActionSetRespawnPoints : public IMissionAction
|
|
|
|
LOGMISSIONACTION("set_respawn_points");
|
|
|
|
LOGMISSIONACTION("set_respawn_points");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -4517,8 +4521,8 @@ class CMissionActionSDBSet : public IMissionAction
|
|
|
|
string _SDBPath;
|
|
|
|
string _SDBPath;
|
|
|
|
sint32 _SDBValue;
|
|
|
|
sint32 _SDBValue;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4555,8 +4559,8 @@ class CMissionActionSDBAdd : public IMissionAction
|
|
|
|
string _SDBPath;
|
|
|
|
string _SDBPath;
|
|
|
|
sint32 _SDBDelta;
|
|
|
|
sint32 _SDBDelta;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4593,8 +4597,8 @@ class CMissionActionSDBPlayerAdd : public IMissionAction
|
|
|
|
string _SDBPath;
|
|
|
|
string _SDBPath;
|
|
|
|
sint32 _SDBDelta;
|
|
|
|
sint32 _SDBDelta;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -4617,7 +4621,7 @@ class CMissionActionSDBPlayerAdd : public IMissionAction
|
|
|
|
LOGMISSIONACTION("sdb_player_add");
|
|
|
|
LOGMISSIONACTION("sdb_player_add");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -4993,7 +4997,7 @@ class CMissionActionCondJumpGuildCiv : public CMissionActionJump
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpGuildCiv,"if_guild_civ");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpGuildCiv,"if_guild_civ");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class CMissionActionCondJumpGuildFame : public CMissionActionJump
|
|
|
|
class CMissionActionCondJumpGuildFame : public CMissionActionJump
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -5073,7 +5077,7 @@ public:
|
|
|
|
MISLOGSYNTAXERROR("<label>");
|
|
|
|
MISLOGSYNTAXERROR("<label>");
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Label = CMissionParser::getNoBlankString(script[1]);
|
|
|
|
Label = CMissionParser::getNoBlankString(script[1]);
|
|
|
|
missionData.Jumps.push_back( Label );
|
|
|
|
missionData.Jumps.push_back( Label );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -5086,7 +5090,7 @@ public:
|
|
|
|
instance->getEntities( entities );
|
|
|
|
instance->getEntities( entities );
|
|
|
|
if ( entities.empty() )
|
|
|
|
if ( entities.empty() )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
// If player have a trial account, do not jump
|
|
|
|
// If player have a trial account, do not jump
|
|
|
|
for (uint i = 0 ; i < entities.size(); ++i)
|
|
|
|
for (uint i = 0 ; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -5106,7 +5110,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCondJumpNoTrial)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionCondJumpNoTrial)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpNoTrial,"if_no_trial");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionCondJumpNoTrial,"if_no_trial");
|
|
|
@ -5223,8 +5227,8 @@ class CMissionActionSDBSetPVPPath : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string _SDBPath;
|
|
|
|
string _SDBPath;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -5245,7 +5249,7 @@ class CMissionActionSDBSetPVPPath : public IMissionAction
|
|
|
|
LOGMISSIONACTION("sdb_set_pvp_path");
|
|
|
|
LOGMISSIONACTION("sdb_set_pvp_path");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -5266,8 +5270,8 @@ MISSION_REGISTER_ACTION(CMissionActionSDBSetPVPPath,"sdb_set_pvp_path");
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class CMissionActionSDBClearPVPPath : public IMissionAction
|
|
|
|
class CMissionActionSDBClearPVPPath : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -5285,7 +5289,7 @@ class CMissionActionSDBClearPVPPath : public IMissionAction
|
|
|
|
LOGMISSIONACTION("sdb_clear_pvp_path");
|
|
|
|
LOGMISSIONACTION("sdb_clear_pvp_path");
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -5367,7 +5371,7 @@ class CMissionActionCondJumpFactionPoint : public CMissionActionJump
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
CMissionActionJump::launch( instance, eventList );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool evaluateFPExpr(double & res, CCharacter * c)
|
|
|
|
bool evaluateFPExpr(double & res, CCharacter * c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string numExpr;
|
|
|
|
string numExpr;
|
|
|
@ -5386,7 +5390,7 @@ class CMissionActionCondJumpFactionPoint : public CMissionActionJump
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i == _FPExpr.size() || factionName.empty())
|
|
|
|
if (i == _FPExpr.size() || factionName.empty())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
PVP_CLAN::TPVPClan clan = PVP_CLAN::fromString(factionName);
|
|
|
|
PVP_CLAN::TPVPClan clan = PVP_CLAN::fromString(factionName);
|
|
|
|
if (clan < PVP_CLAN::BeginClans || clan > PVP_CLAN::EndClans)
|
|
|
|
if (clan < PVP_CLAN::BeginClans || clan > PVP_CLAN::EndClans)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -5420,9 +5424,9 @@ MISSION_REGISTER_ACTION(CMissionActionCondJumpFactionPoint,"if_faction_point");
|
|
|
|
class CMissionActionHandleRelease : public IMissionAction
|
|
|
|
class CMissionActionHandleRelease : public IMissionAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TAIAlias GroupAlias;
|
|
|
|
TAIAlias GroupAlias;
|
|
|
|
|
|
|
|
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
bool buildAction ( uint32 line, const std::vector< std::string > & script,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionGlobalParsingData & globalData,
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
CMissionSpecificParsingData & missionData )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_SourceLine = line;
|
|
|
|
_SourceLine = line;
|
|
|
@ -5442,14 +5446,14 @@ class CMissionActionHandleRelease : public IMissionAction
|
|
|
|
GroupAlias = aliases[0];
|
|
|
|
GroupAlias = aliases[0];
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
void launch(CMission* instance, std::list< CMissionEvent * > & eventList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LOGMISSIONACTION("handle_release");
|
|
|
|
LOGMISSIONACTION("handle_release");
|
|
|
|
|
|
|
|
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
vector<TDataSetRow> entities;
|
|
|
|
instance->getEntities(entities);
|
|
|
|
instance->getEntities(entities);
|
|
|
|
|
|
|
|
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
for (uint32 i = 0; i < entities.size(); ++i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
|
CCharacter *pChar = PlayerManager.getChar(entities[i]);
|
|
|
@ -5461,7 +5465,7 @@ class CMissionActionHandleRelease : public IMissionAction
|
|
|
|
pChar->delHandledAIGroup(instance, GroupAlias);
|
|
|
|
pChar->delHandledAIGroup(instance, GroupAlias);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionHandleRelease)
|
|
|
|
MISSION_ACTION_GETNEWPTR(CMissionActionHandleRelease)
|
|
|
|
};
|
|
|
|
};
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionHandleRelease, "handle_release");
|
|
|
|
MISSION_REGISTER_ACTION(CMissionActionHandleRelease, "handle_release");
|
|
|
|