bool VR_VoiceBoxEventSink::GetActionParameter( IVECIParsedMessage *pcMsg, VoiceVector<NodeInfo>::type& vecActionParameter ) { vecActionParameter.clear(); if (NULL == pcMsg) { return false; } CVECIPtr<IVECIParameterSet> parmeterSet; m_client.CreateParameterSet(&parmeterSet); pcMsg->GetActionParameters(&parmeterSet); VBT_ULONG uSize; if (NULL == parmeterSet) { return false; } parmeterSet->GetSize(&uSize); CVECIOutStr strOut; VBT_STR strVBTValue; std::string strName = ""; std::string strValue = ""; NodeInfo actionNode; for (VBT_ULONG uIndex = 0; uIndex < uSize; ++uIndex) { parmeterSet->GetParameter(uIndex, AttribName, &strOut); strVBTValue = strOut.Get(); if (NULL == strVBTValue) { continue; } strName = strVBTValue; actionNode.strName = strName; parmeterSet->GetParameter(uIndex, AttribValue, &strOut); strVBTValue = strOut.Get(); if (NULL == strVBTValue) { strValue = ""; } else { strValue = strVBTValue; } actionNode.strValue = strValue; vecActionParameter.push_back(actionNode); } return true; }
bool VR_VoiceBoxAppsXml::GetVBTXml(const std::string& xml, VoiceVector<std::string>::type& messages ) { if (xml.empty()) { return false; } pugi::xml_document doc; if (!doc.load(xml.c_str())) { return false; } // Extract the tag:"Mesage" nodes bool bFound = false; pugi::xml_node csvrNodes = doc.child("event").child("CSVR"); for (pugi::xml_node_iterator it = csvrNodes.begin(); it != csvrNodes.end(); ++it) { std::string strTag = it->name(); if ("Message" == strTag) { std::ostringstream oss; it->print(oss); messages.push_back(oss.str()); bFound = true; } } return bFound; }
void InternalCreatureType::reset() { experience = 0; defense = 0; armor = 0; canPushItems = false; canPushCreatures = false; staticAttackChance = 95; maxSummons = 0; targetDistance = 1; fleeHealth = 0; pushable = true; base_speed = 200; health = 100; health_max = 100; outfit.lookHead = 130; // Default man outfit.lookBody = 0; outfit.lookLegs = 0; outfit.lookFeet = 0; outfit.lookType = 0; outfit.lookTypeEx = 0; outfit.lookAddons = 0; corpseId = 0; mechanicImmunities = MECHANIC_NONE; damageImmunities = COMBAT_NONE; race = RACE_BLOOD; isSummonable = false; isIllusionable = false; isConvinceable = false; isAttackable = true; isHostile = true; isLureable = false; lightLevel = 0; lightColor = 0; manaCost = 0; summonList.clear(); lootItems.clear(); elementMap.clear(); spellAttackList.clear(); spellDefenseList.clear(); yellSpeedTicks = 0; yellChance = 0; voiceVector.clear(); changeTargetSpeed = 0; changeTargetChance = 0; //scriptList.clear(); }