public override void InitParameter() { ResetStatusParam(); base.attack.normal = npcAtk; base.defense.normal = base.playerDef; base.defense.fire = base.playerDef; base.defense.water = base.playerDef; base.defense.thunder = base.playerDef; base.defense.soil = base.playerDef; base.defense.light = base.playerDef; base.defense.dark = base.playerDef; base.defenseThreshold = 0; base.defenseCoefficient = new AtkAttribute(); base.hpMax = base.playerHp; if (base.hp > base.hpMax) { int num2 = base.hp = (base.healHp = base.hpMax); } NpcLevelTable.NpcLevelData npcLevel = Singleton <NpcLevelTable> .I.GetNpcLevel((uint)lv, lv_index); if (npcLevel != null) { base.attack.fire = (float)npcLevel.atk_attribute[0]; base.attack.water = (float)npcLevel.atk_attribute[1]; base.attack.thunder = (float)npcLevel.atk_attribute[2]; base.attack.soil = (float)npcLevel.atk_attribute[3]; base.attack.light = (float)npcLevel.atk_attribute[4]; base.attack.dark = (float)npcLevel.atk_attribute[5]; base.tolerance.normal = 0f; base.tolerance.fire = (float)npcLevel.tolerance[0]; base.tolerance.water = (float)npcLevel.tolerance[1]; base.tolerance.thunder = (float)npcLevel.tolerance[2]; base.tolerance.soil = (float)npcLevel.tolerance[3]; base.tolerance.light = (float)npcLevel.tolerance[4]; base.tolerance.dark = (float)npcLevel.tolerance[5]; } }
public Player CreateNonPlayer(int id, CreatePlayerInfo.ExtentionInfo extention_info, Vector3 pos, float dir, PlayerTransferInfo transfer_info = null, PlayerLoader.OnCompleteLoad callback = null) { //IL_0237: Unknown result type (might be due to invalid IL or missing references) CreatePlayerInfo createPlayerInfo = new CreatePlayerInfo(); createPlayerInfo.charaInfo = new CharaInfo(); bool flag = QuestManager.IsValidInGame() && MonoBehaviourSingleton <QuestManager> .I.GetVorgonQuestType() != QuestManager.VorgonQuetType.NONE; bool flag2 = false; if (extention_info != null) { createPlayerInfo.extentionInfo = extention_info; } else { createPlayerInfo.extentionInfo = new CreatePlayerInfo.ExtentionInfo(); flag2 = true; } NPCTable.NPCData nPCData = null; if (flag2) { List <int> list = new List <int>(); int i = 0; for (int count = nonplayerList.Count; i < count; i++) { NonPlayer nonPlayer = nonplayerList[i] as NonPlayer; if (nonPlayer != null) { list.Add(nonPlayer.npcId); } } nPCData = Singleton <NPCTable> .I.GetNPCDataRandom(NPCTable.NPC_TYPE.FIGURE, list); if (nPCData != null) { createPlayerInfo.extentionInfo.npcDataID = nPCData.id; } } else { nPCData = Singleton <NPCTable> .I.GetNPCData(createPlayerInfo.extentionInfo.npcDataID); } if (flag) { int npc_id = VorgonPreEventController.NPC_ID_LIST[id % 3]; nPCData = Singleton <NPCTable> .I.GetNPCData(npc_id); } if (nPCData == null) { return(null); } nPCData.CopyCharaInfo(createPlayerInfo.charaInfo); NpcLevelTable.NpcLevelData npcLevelData = null; if (flag2) { int lv = 1; if (QuestManager.IsValidInGame() && MonoBehaviourSingleton <QuestManager> .I.GetCurrentQuestEnemyID() > 0) { lv = MonoBehaviourSingleton <QuestManager> .I.GetCurrentQuestEnemyLv(); } if (flag) { lv = 80; } npcLevelData = Singleton <NpcLevelTable> .I.GetNpcLevelRandom((uint)lv); if (npcLevelData != null) { createPlayerInfo.extentionInfo.npcLv = (int)npcLevelData.lv; createPlayerInfo.extentionInfo.npcLvIndex = npcLevelData.lvIndex; } } else { npcLevelData = Singleton <NpcLevelTable> .I.GetNpcLevel((uint)createPlayerInfo.extentionInfo.npcLv, createPlayerInfo.extentionInfo.npcLvIndex); } if (npcLevelData == null) { return(null); } npcLevelData.CopyHomeCharaInfo(createPlayerInfo.charaInfo, (!flag2) ? null : createPlayerInfo.extentionInfo); if (flag) { for (int j = 0; j < createPlayerInfo.charaInfo.equipSet.Count; j++) { createPlayerInfo.charaInfo.equipSet[j].eId = VorgonPreEventController.NPC_WEAPON_ID_LIST[id % 3]; } } return(CreatePlayer(id, createPlayerInfo, false, pos, dir, transfer_info, callback)); }