void GenerateItem() { if (!isServer) { return; } // 아이템 생성 확율을 검사 float ItemGen = Random.Range(0.0f, 100.0f); if (ItemGen > ItemDropRate) { return; } ItemDropTable itemDropTable = SystemManager.Instance.ItemDropTable; ItemDropStruct dropStruct = itemDropTable.GetDropData(ItemDropID); // 어느 아이템을 생성할 것인지 확율 검사 ItemGen = Random.Range(0, dropStruct.Rate1 + dropStruct.Rate2 + dropStruct.Rate3); int ItemIndex = -1; if (ItemGen <= dropStruct.Rate1) // 1번 아이템 비율보다 작은 경우 { ItemIndex = dropStruct.ItemID1; } else if (ItemGen <= (dropStruct.Rate1 + dropStruct.Rate2)) // 2번 아이템 비율보다 작은 경우 { ItemIndex = dropStruct.ItemID2; } else //if (ItemGen <= (dropStruct.Rate1 + dropStruct.Rate2 + dropStruct.Rate3)) // 3번 아이템 비율인 경우 { ItemIndex = dropStruct.ItemID3; } Debug.Log("GenerateItem ItemIndex = " + ItemIndex); InGameSceneMain inGameSceneMain = SystemManager.Instance.GetCurrentSceneMain <InGameSceneMain>(); inGameSceneMain.ItemBoxManager.Generate(ItemIndex, transform.position); }
public void Parse(GameBitBuffer buffer) { Field0 = buffer.ReadInt(32); Field1 = buffer.ReadCharArray(256); Field2 = buffer.ReadCharArray(256); Field3 = buffer.ReadInt(32); Field4 = buffer.ReadInt(32); tItemTypeTable = new Items(); tItemTypeTable.Parse(buffer); tItemTable = new Items(); tItemTable.Parse(buffer); tExperienceTable = new ExperienceTable(); tExperienceTable.Parse(buffer); tHelpCodesTable = new HelpCodes(); tHelpCodesTable.Parse(buffer); tMonsterLevelTable = new MonsterLevelTable(); tMonsterLevelTable.Parse(buffer); tAffixTable = new AffixTable(); tAffixTable.Parse(buffer); tHeroTable = new Heros(); tHeroTable.Parse(buffer); tMovementStyleTable = new MovementStyles(); tMovementStyleTable.Parse(buffer); tLabelGBIDTable = new Labels(); tLabelGBIDTable.Parse(buffer); tLootDistTable = new LootDistributionTable(); tLootDistTable.Parse(buffer); tRareItemNamesTable = new RareItemNamesTable(); tRareItemNamesTable.Parse(buffer); tMonsterAffixesTable = new MonsterAffixesTable(); tMonsterAffixesTable.Parse(buffer); tMonsterNamesTable = new RareMonsterNamesTable(); tMonsterNamesTable.Parse(buffer); tSocketedEffectTable = new SocketedEffectsTable(); tSocketedEffectTable.Parse(buffer); tItemEnhancementTable = new ItemEnhancementTable(); tItemEnhancementTable.Parse(buffer); tItemDropTable = new ItemDropTable(); tItemDropTable.Parse(buffer); tItemLevelModTable = new ItemLevelModTable(); tItemLevelModTable.Parse(buffer); tQualityClassTable = new QualityClassTable(); tQualityClassTable.Parse(buffer); tHirelingTable = new Hirelings(); tHirelingTable.Parse(buffer); tSetItemBonusTable = new SetItemBonusTable(); tSetItemBonusTable.Parse(buffer); tEliteModTable = new EliteModifiers(); tEliteModTable.Parse(buffer); tItemTierTable = new ItemTiers(); tItemTierTable.Parse(buffer); tPowerFormulaTable = new PowerFormulaTable(); tPowerFormulaTable.Parse(buffer); tRecipeTable = new RecipesTable(); tRecipeTable.Parse(buffer); tScriptedAchievementEventsTable = new ScriptedAchievementEventsTable(); tScriptedAchievementEventsTable.Parse(buffer); }