bool psTradePatterns::Load(iResultRow& row) { id = row.GetUInt32("id"); patternName = row["pattern_name"]; groupPatternId = row.GetUInt32("group_id"); designItemId = row.GetUInt32("designitem_id"); KFactor = row.GetFloat("k_factor"); return true; }
bool psTradeCombinations::Load(iResultRow& row) { id = row.GetUInt32("id"); patternId = row.GetUInt32("pattern_id"); resultId = row.GetUInt32("result_id"); resultQty = row.GetInt("result_qty"); itemId = row.GetUInt32("item_id"); minQty = row.GetInt("min_qty"); maxQty = row.GetInt("max_qty"); return true; }
bool psTradeTransformations::Load(iResultRow& row) { id = row.GetUInt32("id"); patternId = row.GetUInt32("pattern_id"); processId = row.GetUInt32("process_id"); resultId = row.GetUInt32("result_id"); resultQty = row.GetInt("result_qty"); itemId = row.GetUInt32("item_id"); itemQty = row.GetInt("item_qty"); transPoints = row.GetInt("trans_points"); penaltyPct = row.GetFloat("penalty_pct"); return true; }
bool psTradeProcesses::Load(iResultRow& row) { processId = row.GetUInt32("process_id"); subprocess = row.GetInt("subprocess_number"); name = row["name"]; animation = row["animation"]; workItemId = row.GetUInt32("workitem_id"); equipmentId = row.GetUInt32("equipment_id"); constraints = row["constraints"]; garbageId = row.GetUInt32("garbage_id"); garbageQty = row.GetInt("garbage_qty"); priSkillId = row.GetInt("primary_skill_id"); minPriSkill = row.GetInt("primary_min_skill"); maxPriSkill = row.GetInt("primary_max_skill"); priPracticePts = row.GetInt("primary_practice_points"); priQualFactor = row.GetInt("primary_quality_factor"); secSkillId = row.GetInt("secondary_skill_id"); minSecSkill = row.GetInt("secondary_min_skill"); maxSecSkill = row.GetInt("secondary_max_skill"); secPracticePts = row.GetInt("secondary_practice_points"); secQualFactor = row.GetInt("secondary_quality_factor"); renderEffect = row["render_effect"]; return true; }
bool psQuest::Load(iResultRow& row) { id = row.GetInt("id"); name = row["name"]; task = row["task"]; flags = row.GetInt("flags"); step_id = row.GetInt("minor_step_number"); category = row["category"]; prerequisiteStr = row["prerequisite"]; if(flags & PSQUEST_DISABLED_QUEST) //the quest is set as disabled Active(false); parent_quest = CacheManager::GetSingleton().GetQuestByID( row.GetUInt32("master_quest_id") ); image = row["cstr_icon"]; if(!image) { Error2("Invalid 'cstr_icon' for quest '%s'\n", name.GetData()); } CacheManager::GetSingleton().AddCommonStringID(image); // the value is expressed in seconds int lockout_time = row.GetInt("player_lockout_time"); if (lockout_time < 0) { infinitePlayerLockout = true; player_lockout_time = 0; } else { infinitePlayerLockout = false; player_lockout_time = lockout_time; } quest_lockout_time = row.GetInt("quest_lockout_time"); return true; }
bool psRaceInfo::Load(iResultRow &row) { uid = row.GetUInt32("id"); name = row["name"]; psserver->GetCacheManager()->AddCommonStringID(name); initialCP = row.GetUInt32("initial_cp"); race = row.GetUInt32("race"); helmGroup = row["helm"]; BracerGroup = row["bracer"]; BeltGroup = row["belt"]; CloakGroup = row["cloak"]; MounterAnim = row["cstr_mounter_animation"]; psserver->GetCacheManager()->AddCommonStringID(MounterAnim); sex = row["sex"]; scale = row.GetFloat("scale"); speedModifier = row.GetFloat("speed_modifier"); gender = psserver->GetCacheManager()->ConvertGenderString(row["sex"]); iResultSet* rs = db->Select("SELECT * FROM race_spawns WHERE raceid = %lu", race); if(!rs || rs->Count() == 0) { Error2("Race spawn points for race %d not found.", race); return false; } for(unsigned int i = 0 ; i < rs->Count() ; i++) { psRaceStartingLocation startingLoc; //prepare x,y,z and rotation of the spawn point startingLoc.x = (*rs)[i].GetFloat("x"); startingLoc.y = (*rs)[i].GetFloat("y"); startingLoc.z = (*rs)[i].GetFloat("z"); startingLoc.yrot = (*rs)[i].GetFloat("yrot"); //set a range used to select a random point within it from the x and z startingLoc.range = (*rs)[i].GetFloat("range"); psSectorInfo* secinfo=psserver->GetCacheManager()->GetSectorInfoByID((*rs)[i].GetUInt32("sector_id")); if(secinfo==NULL) { Error3("Unresolvable sector id %lu in start_sector_id field of race info for race %u. Failing!", (*rs)[i].GetUInt32("sector_id"),race); return false; } startingLoc.sector_name = secinfo->name; startingLocations.Push(startingLoc); } rs->Release(); size.x = row.GetFloat("size_x"); size.y = row.GetFloat("size_y"); size.z = row.GetFloat("size_z"); // Z size and X size (width and length) need to be equal because the collision reaction system // does not know how to cope with rotations. An ellipsoid would be more ideal. size.z = size.x = csMax(size.x, size.z); baseRegen[PSRACEINFO_STAMINA_PHYSICAL_STILL] = row.GetFloat("base_physical_regen_still"); baseRegen[PSRACEINFO_STAMINA_PHYSICAL_WALK] = row.GetFloat("base_physical_regen_walk"); baseRegen[PSRACEINFO_STAMINA_MENTAL_STILL] = row.GetFloat("base_mental_regen_still"); baseRegen[PSRACEINFO_STAMINA_MENTAL_WALK] = row.GetFloat("base_mental_regen_walk"); mesh_name = row["cstr_mesh"]; if(!mesh_name) { Error2("Invalid 'cstr_mesh' for race '%s'\n", name.GetData()); } psserver->GetCacheManager()->AddCommonStringID(mesh_name); base_texture_name = row["cstr_base_texture"]; psserver->GetCacheManager()->AddCommonStringID(base_texture_name); // Load starting stats SetBaseAttribute(PSITEMSTATS_STAT_STRENGTH ,row.GetUInt32("start_str")); SetBaseAttribute(PSITEMSTATS_STAT_ENDURANCE ,row.GetUInt32("start_end")); SetBaseAttribute(PSITEMSTATS_STAT_AGILITY ,row.GetUInt32("start_agi")); SetBaseAttribute(PSITEMSTATS_STAT_INTELLIGENCE ,row.GetUInt32("start_int")); SetBaseAttribute(PSITEMSTATS_STAT_WILL ,row.GetUInt32("start_will")); SetBaseAttribute(PSITEMSTATS_STAT_CHARISMA ,row.GetUInt32("start_cha")); // Load natural armor natural_armor_id = row.GetUInt32("armor_id"); // Load natural claws/weapons natural_weapon_id = row.GetUInt32("weapon_id"); return true; }