virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) { static const std::string stepText = "MIS_KILL_FACTION"; static const std::string stepTextLoc = "MIS_KILL_FACTION_LOC"; nlassert( subStepStates.size() == 1); nbSubSteps = 1; retParams.push_back(STRING_MANAGER::TParam(STRING_MANAGER::faction)); retParams.back().Enum = _Faction; retParams.push_back(STRING_MANAGER::TParam(STRING_MANAGER::integer, sint32(_Quantity))); if ( _Place != 0xFFFF ) { STRING_MANAGER::TParam param; param.Type = STRING_MANAGER::place; CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place); if ( !place ) { MISLOG("sline:%u ERROR : kill_faction : invalid place %u", _SourceLine, _Place); } else { param.Identifier = place->getName(); retParams.push_back(param); } textPtr = &stepTextLoc; } else textPtr = &stepText; }
virtual void getTextParams( uint & nbSubSteps, const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) { static const std::string stepTextNoLoc = "MIS_KILL_NPC_BY_NAME"; static const std::string stepTextLoc = "MIS_KILL_NPC_BY_NAME_LOC"; if ( Place != 0xFFFF ) retParams.resize(3); else retParams.resize(2); retParams[0].Type = STRING_MANAGER::bot_name; retParams[0].Identifier = TargetName; retParams[1].Type = STRING_MANAGER::integer; nlassert( subStepStates.size() == 1 ); retParams[1].Int = subStepStates[0]; if ( Place != 0xFFFF ) { CPlace * place = CZoneManager::getInstance().getPlaceFromId( Place ); if ( !place ) { MISLOG("sline:%u ERROR : kill_npc_by_name : invalid place %u", _SourceLine, Place); } else { retParams[2].Type = STRING_MANAGER::place; retParams[2].Identifier = place->getName(); textPtr = &stepTextLoc; } } else textPtr = &stepTextNoLoc; }
void main() { CPlace *s = new CPlace(L"Thanh"); CMap a; a.setNew(s->getName()); float z = a.finalPath(0, 4); cout << z; }
virtual void getTextParams( uint & nbSubSteps, const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) { static const std::string stepText = "MIS_KILL_RACE_"; static const std::string stepTextLoc = "MIS_KILL_RACE_LOC_"; nlassert( _SubSteps.size() == subStepStates.size() ); for ( uint i = 0; i < subStepStates.size(); i++ ) { if( subStepStates[i] != 0 ) { nbSubSteps++; retParams.push_back(STRING_MANAGER::TParam()); retParams.back().Type = STRING_MANAGER::race; retParams.back().Enum = (uint)_SubSteps[i].Race; retParams.push_back(STRING_MANAGER::TParam()); retParams.back().Type = STRING_MANAGER::integer; retParams.back().Int = subStepStates[i]; } } if ( _Place != 0xFFFF ) { STRING_MANAGER::TParam param; param.Type = STRING_MANAGER::place; CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place); if ( !place ) { MISLOG("sline:%u ERROR : kill_race : Invalid place %u", _SourceLine, _Place); } else { param.Identifier = place->getName(); retParams.push_back(param); } textPtr = &stepTextLoc; } else textPtr = &stepText; }