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; }
//-------------------------------------------------------------- // CCombatStunEffect::removed() //-------------------------------------------------------------- void CCombatStunEffect::removed() { if (!_StunnedEntity) return; // returns if entity already dead if (_StunnedEntity->isDead()) return; DEBUGLOG("COMBAT EFFECT: stun effect ends on entity %s", _StunnedEntity->getId().toString().c_str()); // if this is the last STUN effect on target, then wake it const std::vector<CSEffect*>& effects = _StunnedEntity->getSEffects(); for (uint i = 0 ; i < effects.size() ; ++i) { if (effects[i] && effects[i] != this && (effects[i]->getFamily() == EFFECT_FAMILIES::Stun || effects[i]->getFamily() == EFFECT_FAMILIES::CombatStun) ) { DEBUGLOG("COMBAT EFFECT : entity is still stunned (has another stun effect)"); return; } } // wake entity _StunnedEntity->wake(); DEBUGLOG("COMBAT EFFECT : was last stun effects on this entity, wake it"); CEntityId actorId; if (TheDataset.isDataSetRowStillValid(_CreatorRowId)) actorId = TheDataset.getEntityId(_CreatorRowId); // send message // PHRASE_UTILITIES::sendSimpleMessage( _TargetRowId, "OPS_EFFECT_STUN_END" ); // PHRASE_UTILITIES::sendMessage( _CreatorRowId, "OPS_EFFECT_STUN_END_E", _TargetRowId ); TVectorParamCheck params; if (_StunnedEntity->getId().getType() == RYZOMID::player) { PHRASE_UTILITIES::sendDynamicSystemMessage(_StunnedEntity->getEntityRowId(), "EFFECT_STUN_END_TARGET"); } if ( actorId.getType() == RYZOMID::player) { params.resize(1); params[0].Type = STRING_MANAGER::entity; params[0].EId = _StunnedEntity->getId(); PHRASE_UTILITIES::sendDynamicSystemMessage(_CreatorRowId, "EFFECT_STUN_END_ACTOR", params); } // todo spectators and self stun } // removed //
bool CMissionParser::parseParamText(uint32 line, const std::string & script,std::string & textId, TVectorParamCheck & textParams ) { vector< string > args; splitString(script,";",args); textId = CMissionParser::getNoBlankString(args[0]); if( textId.find_first_of(";:\t ,") != string::npos ) { MISLOG("<MISSIONS> line %u: invalid text %s", line, textId.c_str() ); return false; } textParams.resize( args.size() - 1 ); for ( uint i = 1; i < args.size(); i++ ) { CMissionParser::removeBlanks(args[i]); textParams[i-1].Identifier = args[i]; } return true; }