• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[BUG] Killing in the name of.. - QuestLog 0.3

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I'm getting this problem with my questlog..

PM8Wq.png


Using this:
>>1198052

I didn't make any source edit, so, I don't know if is that.

[cpp]std::string Mission::getDescription(Player* player)
{
if(!player)
return "Couldn't retrieve any mission description, please report to a gamemaster.";

std::string value;
player->getStorage(storageId, value);
if(!states.empty())
{
int32_t cmp = atoi(value.c_str());
if(cmp >= endValue)
return parseStorages(states.rbegin()->second, value, player);

for(int32_t i = (endValue - 1); i >= startValue; --i)
{
if(cmp != i)
continue;

std::string tmp = states;
if(!tmp.empty())
return parseStorages(tmp, value, player);
}
}

if(state.size())
return parseStorages(state, value, player);

return "Couldn't retrieve any mission description, please report to a gamemaster.";
}[/cpp]

[cpp] for(xmlNodePtr missionNode = p->children; missionNode; missionNode = missionNode->next)
{
if(xmlStrcmp(missionNode->name, (const xmlChar*)"mission"))
continue;

std::string missionName, missionState, storageId;
if(readXMLString(missionNode, "name", strValue))
missionName = strValue;

if(readXMLString(missionNode, "state", strValue) || readXMLString(missionNode, "description", strValue))
missionState = strValue;

if(readXMLString(missionNode, "storageid", strValue) || readXMLString(missionNode, "storageId", strValue))
storageId = strValue;

int32_t startValue = 0, endValue = 0;
if(readXMLInteger(missionNode, "startvalue", intValue) || readXMLInteger(missionNode, "startValue", intValue))
startValue = intValue;

if(readXMLInteger(missionNode, "endvalue", intValue) || readXMLInteger(missionNode, "endValue", intValue))
endValue = intValue;

bool notify = true;
if(readXMLString(missionNode, "notify", strValue))
notify = booleanString(strValue);

if(Mission* mission = new Mission(missionName, missionState, storageId, startValue, endValue, notify))
{
// parse sub-states only if main is not set
for(xmlNodePtr stateNode = missionNode->children; stateNode; stateNode = stateNode->next)
{
if(xmlStrcmp(stateNode->name, (const xmlChar*)"missionstate"))
continue;

if(!readXMLString(stateNode, "id", strValue))
{
std::clog << "[Warning - Quests::parseQuestNode] Missing missionId for mission state" << std::endl;
continue;
}

std::string description, strDesc;
if(readXMLString(stateNode, "description", strDesc))
description = strDesc;

StringVec strVector = explodeString(strValue, "-");
if(strVector.size() > 1)
{
IntegerVec intVector = vectorAtoi(strVector);
if(intVector[0] && intVector[1])
{
for(int32_t i = intVector[0]; i <= intVector[1]; i++)
mission->newState(i, description);
}
else
std::clog << "Invalid mission state id '" << strValue << "' for mission '" << mission->getName(NULL) << "'" << std::endl;

continue;
}
else
mission->newState(atoi(strValue.c_str()), description);
}

quest->newMission(mission);
}
}[/cpp]

Thanks.

.. Using 0.3.7
 
Last edited:
Back
Top