Merge branch 'ark'

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent 9b475fde60
commit aad1a6edd0
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -2891,6 +2891,9 @@ NLMISC_COMMAND(spawnArkMission,"spawn Mission","<uid> <bot_name> <mission_name>"
return false; return false;
} }
c->removeMission(missionAlias, 0, true);
c->removeMissionFromHistories(missionAlias);
c->endBotChat(); c->endBotChat();
std::list< CMissionEvent* > eventList; std::list< CMissionEvent* > eventList;

@ -13778,7 +13778,7 @@ void CCharacter::abandonMission(uint8 indexClient)
if (params.size() >= 1) if (params.size() >= 1)
{ {
if (mission->getFinished() && mission->getMissionSuccess()) if (mission->getFinished() && mission->getMissionSuccess())
validateDynamicMissionStep(params[0]+"&result=SUCCESS"); validateDynamicMissionStep(params[0]+"&result=FINABD");
else else
validateDynamicMissionStep(params[0]+"&result=ABD"); validateDynamicMissionStep(params[0]+"&result=ABD");
setCustomMissionParams(toUpper(templ->getMissionName())+"_CALLBACK", ""); setCustomMissionParams(toUpper(templ->getMissionName())+"_CALLBACK", "");
@ -14687,6 +14687,21 @@ void CCharacter::updateSavedMissions()
mission->setClientIndex(idx); mission->setClientIndex(idx);
mission->putInGame(); mission->putInGame();
mission->updateUsersJournalEntry(); mission->updateUsersJournalEntry();
sint32 x = 0;
sint32 y = 0;
string msg;
getPositionCheck(toUpper(templ->getMissionName()), x, y, msg);
if (x != 0 && y != 0)
{
SM_STATIC_PARAMS_1(textParams, STRING_MANAGER::literal);
textParams[0].Literal.fromUtf8(msg);
uint32 txt = STRING_MANAGER::sendStringToClient(getEntityRowId(), "LITERAL", textParams );
(*it).second->addCompassTarget((TAIAlias)txt,true,true);
}
list<CMissionEvent*> eventList; list<CMissionEvent*> eventList;
for (map<uint32, EGSPD::CActiveStepPD>::iterator itStep = mission->getStepsBegin(); for (map<uint32, EGSPD::CActiveStepPD>::iterator itStep = mission->getStepsBegin();
@ -14725,16 +14740,31 @@ void CCharacter::updateSavedMissions()
mission->setTaker(_EntityRowId); mission->setTaker(_EntityRowId);
mission->putInGame(); mission->putInGame();
sint32 x = 0;
sint32 y = 0;
string msg;
getPositionCheck(toUpper(templ->getMissionName()), x, y, msg);
for (map<uint32, EGSPD::CMissionCompassPD>::iterator itCompass = (*it).second->getCompassBegin(); for (map<uint32, EGSPD::CMissionCompassPD>::iterator itCompass = (*it).second->getCompassBegin();
itCompass != (*it).second->getCompassEnd(); ++itCompass) itCompass != (*it).second->getCompassEnd(); ++itCompass)
{ {
TVectorParamCheck params(1); TVectorParamCheck params(1);
sint32 x = 0; x = 0;
sint32 y = 0; y = 0;
string msg; msg = "";
CCreature* c = CreatureManager.getCreature(
CAIAliasTranslator::getInstance()->getEntityId((*itCompass).second.getBotId())); getPositionCheck(toUpper(templ->getMissionName()), x, y, msg);
if (x != 0 && y != 0)
{
SM_STATIC_PARAMS_1(textParams, STRING_MANAGER::literal);
textParams[0].Literal.fromUtf8(msg);
uint32 txt = STRING_MANAGER::sendStringToClient(getEntityRowId(), "LITERAL", textParams );
PlayerManager.sendImpulseToClient(_Id, "JOURNAL:ADD_COMPASS", x, y, txt);
++it;
continue;
}
CCreature* c = CreatureManager.getCreature(CAIAliasTranslator::getInstance()->getEntityId((*itCompass).second.getBotId()));
if (c) if (c)
{ {
x = c->getState().X(); x = c->getState().X();
@ -14746,25 +14776,12 @@ void CCharacter::updateSavedMissions()
params[0].setEIdAIAlias(c->getId(), CAIAliasTranslator::getInstance()->getAIAlias(c->getId())); params[0].setEIdAIAlias(c->getId(), CAIAliasTranslator::getInstance()->getAIAlias(c->getId()));
msg = "COMPASS_BOT"; msg = "COMPASS_BOT";
uint32 txt = STRING_MANAGER::sendStringToClient(_EntityRowId, msg, params); uint32 txt = STRING_MANAGER::sendStringToClient(_EntityRowId, msg, params);
PlayerManager.sendImpulseToClient( PlayerManager.sendImpulseToClient(_Id, "JOURNAL:ADD_COMPASS_BOT", x, y, txt, c->getEntityRowId().getCompressedIndex());
_Id, "JOURNAL:ADD_COMPASS_BOT", x, y, txt, c->getEntityRowId().getCompressedIndex());
} }
else else
{ {
CMissionTemplate * templ = CMissionManager::getInstance()->getTemplate((*it).second->getTemplateId());
string textName;
getPositionCheck(toUpper(templ->getMissionName()), x, y, textName);
if (x != 0 && y != 0)
{
SM_STATIC_PARAMS_1(textParams, STRING_MANAGER::literal);
textParams[0].Literal.fromUtf8(textName);
uint32 txt = STRING_MANAGER::sendStringToClient( c->getEntityRowId(), "LITERAL", textParams );
PlayerManager.sendImpulseToClient(_Id, "JOURNAL:ADD_COMPASS", x, y, txt);
}
else
{
CPlace* place = CZoneManager::getInstance().getPlaceFromId((uint16)(*itCompass).second.getPlace());
CPlace* place = CZoneManager::getInstance().getPlaceFromId((uint16)(*itCompass).second.getPlace());
if (place) if (place)
{ {
x = place->getCenterX(); x = place->getCenterX();
@ -14777,7 +14794,6 @@ void CCharacter::updateSavedMissions()
} }
} }
} }
}
++it; ++it;
} }

Loading…
Cancel
Save