protected override void StartHighEff() { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(this.data.strParam1); Dictionary <DataType, object> dictionary = new Dictionary <DataType, object>(); if (this.data.param1 == 1f) { dictionary.Add(DataType.NameId, this.data.strParam1); dictionary.Add(DataType.ModelId, monsterMainData.model_id); dictionary.Add(DataType.TeamType, base.unit.teamType); dictionary.Add(DataType.AttrFactor, GameManager.Instance.Spawner.GetAttrFactor((TeamType)base.unit.teamType)); dictionary.Add(DataType.AIType, (int)this.data.param2); Units units = MapManager.Instance.SpawnMonster(dictionary, null, base.unit.mTransform.position, base.unit.mTransform.rotation); } else if (this.data.param1 != 2f) { if (this.data.param1 != 3f) { if (this.data.param1 != 4f) { if (this.data.param1 == 5f) { dictionary.Add(DataType.NameId, this.data.strParam1); dictionary.Add(DataType.TeamType, base.unit.teamType); Units units = MapManager.Instance.SpawnBuffItem(dictionary, null, base.unit.mTransform.position, base.unit.mTransform.rotation, UnitControlType.None); } } } } }
public Dictionary <AttrType, float> GetMonsterProperty(string npc_id, float attr_factor = 1f) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(npc_id); return(new Dictionary <AttrType, float> { { AttrType.Hp, monsterMainData.hp *attr_factor }, { AttrType.HpMax, monsterMainData.hp *attr_factor }, { AttrType.Mp, monsterMainData.mp *attr_factor }, { AttrType.MpMax, monsterMainData.mp *attr_factor }, { AttrType.Armor, monsterMainData.armor *attr_factor } }); }
private static string GetResId(EntityVo vo) { if (vo == null) { return(null); } string npc_id = vo.npc_id; if (npc_id != string.Empty) { if (vo.entity_type == EntityType.Hero) { SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(npc_id); if (heroMainData == null) { } return(heroMainData.model_id); } if (vo.entity_type == EntityType.Monster) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(npc_id); return(monsterMainData.model_id); } ClientLogger.Error("cannot support " + vo.entity_type); } return(null); }
public void InsertMonsterSkillData(ref SysMonsterMainVo monsterMain) { if (monsterMain == null) { Debug.LogError("InsertMonsterSkillData Error!!"); return; } string[] stringValue = StringUtils.GetStringValue(monsterMain.attack_id, ','); if (!ArrayTool.isNullOrEmpty(stringValue)) { string[] array = stringValue; for (int i = 0; i < array.Length; i++) { string skillID = array[i]; this.InsertData(skillID, 0); } } string[] stringValue2 = StringUtils.GetStringValue(monsterMain.skill_id, ','); if (!ArrayTool.isNullOrEmpty(stringValue2)) { string[] array2 = stringValue2; for (int j = 0; j < array2.Length; j++) { string skillID2 = array2[j]; this.InsertData(skillID2, 0); } } }
private void SetConfigData() { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(this.self.npc_id); base.SetData(DataType.NameId, monsterMainData.npc_id); base.SetData(DataType.DisplayName, monsterMainData.name); base.SetData(DataType.ModelId, monsterMainData.model_id); base.SetData(DataType.MusicId, monsterMainData.music_id); base.SetData(DataType.ItemType, monsterMainData.item_type); base.SetData(DataType.CharacterType, monsterMainData.character_type); base.SetData(DataType.AttackType, monsterMainData.atk_type); base.SetData(DataType.Skills, StringUtils.GetStringValue(monsterMainData.skill_id, ',')); base.SetData(DataType.Attacks, StringUtils.GetStringValue(monsterMainData.attack_id, ',')); base.SetData(DataType.EffectId, monsterMainData.effect_id); base.SetAttr(AttrType.Attack, monsterMainData.attack); base.SetAttr(AttrType.Armor, monsterMainData.armor); base.SetAttr(AttrType.MagicResist, monsterMainData.resistance); base.SetAttr(AttrType.HpMax, monsterMainData.hp); base.SetAttr(AttrType.MpMax, monsterMainData.mp); base.SetAttr(AttrType.HpRestore, monsterMainData.hp_restore); base.SetAttr(AttrType.MpRestore, monsterMainData.mp_restore); base.SetAttr(AttrType.PhysicPower, monsterMainData.pysic_power); base.SetAttr(AttrType.MagicPower, monsterMainData.magic_power); base.SetAttr(AttrType.HitProp, monsterMainData.hit_prop); base.SetAttr(AttrType.DodgeProp, monsterMainData.dodge_prop); base.SetAttr(AttrType.PhysicCritProp, monsterMainData.physic_crit_prop); base.SetAttr(AttrType.MagicCritProp, monsterMainData.magic_crit_prop); base.SetAttr(AttrType.AttackSpeed, monsterMainData.atk_speed); base.SetAttr(AttrType.MoveSpeed, monsterMainData.move_speed); base.SetAttr(AttrType.PhysicCritMag, monsterMainData.crit_mag); base.SetAttr(AttrType.MagicCritMag, monsterMainData.magic_crit_mag); base.SetAttr(AttrType.ArmorCut, monsterMainData.armor_cut); base.SetAttr(AttrType.ArmorCut_Percentage, 0f); base.SetAttr(AttrType.MagicResistanceCut, monsterMainData.resistance_cut); base.SetAttr(AttrType.MagicResistanceCut_Percentage, 0f); base.SetAttr(AttrType.AttackRange, monsterMainData.atk_range); base.SetAttr(AttrType.WarningRange, monsterMainData.warning_range); base.SetAttr(AttrType.Shield, 0f); base.SetAttr(AttrType.FogRange, monsterMainData.player_range); base.SetAttr(AttrType.RealSightRange, monsterMainData.eye_range); base.SetAttr(AttrType.PhysicDamageAdd, 0f); base.SetAttr(AttrType.PhysicDamagePercent, 0f); base.SetAttr(AttrType.MagicDamageAdd, 0f); base.SetAttr(AttrType.MagicDamagePercent, 0f); base.SetAttr(AttrType.AttackDamageAdd, 0f); base.SetAttr(AttrType.AttackDamagePercent, 0f); base.SetAttr(AttrType.PhysicDamageCut, 0f); base.SetAttr(AttrType.PhysicDamagePercentCut, 0f); base.SetAttr(AttrType.MagicDamageCut, 0f); base.SetAttr(AttrType.MagicDamagePercentCut, 0f); base.SetAttr(AttrType.AttackDamageCut, 0f); base.SetAttr(AttrType.AttackDamagePercentCut, 0f); base.SetAttr(AttrType.MoFaHuDunCoverProportion, 0f); base.SetAttr(AttrType.NormalSkillCooling, 0f); base.SetAttr(AttrType.SummonSkillCooling, 0f); base.SetAttr(AttrType.ItemSkillCooling, 0f); base.SetAttr(AttrType.DamageMultiple, 1f); this.self.sourceAnimSpeed = monsterMainData.atk_speed; this.self.sourceMoveSpeed = monsterMainData.move_speed; }
private UtilMonsterData.UnitReward GetMonsterReward(string inMonsterMainId) { if (!StringUtils.CheckValid(inMonsterMainId)) { return(null); } if (this._dataMgr == null) { return(null); } UtilMonsterData utilMonsterData = this._dataMgr.GetUtilDataByType(UtilDataType.Battle_attr_reward, SceneInfo.Current.BattleAttrIndex) as UtilMonsterData; if (utilMonsterData == null) { Debug.LogError("no data for battle_attr_reward"); return(null); } SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(inMonsterMainId); if (monsterMainData == null) { return(null); } return(utilMonsterData.GetReward(monsterMainData.battle_attr_reward)); }
protected override void OnInit(bool isRebirth = false) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(this.npc_id); string music_id = monsterMainData.music_id; AudioMgr.loadSoundBank_Skill("Tower", true, 0); base.OnInit(false); }
public Units SpawnEyeItemInstance(EntityVo npcinfo, string tag, TeamType teamType, string respawnInterval, Transform newSpawnPoint, SVector3 eyeItemInfoInst, string eyeItemPreObjRes, UnitControlType controlType) { if (npcinfo == null || npcinfo.npc_id == null || npcinfo.npc_id == string.Empty || tag == null) { return(null); } string npc_id = npcinfo.npc_id; SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(npc_id); if (monsterMainData == null) { ClientLogger.Error("SpawnInstance: no npc found #" + npc_id); return(null); } Dictionary <DataType, object> dictionary = new Dictionary <DataType, object> { { DataType.NameId, npc_id }, { DataType.ModelId, monsterMainData.model_id }, { DataType.TeamType, teamType }, { DataType.AIType, npcinfo.ai_type }, { DataType.AttrFactor, SpawnUtility.GetAttrFactor(teamType, this._myScene) } }; if (npcinfo.uid != 0) { dictionary.Add(DataType.UniqueId, npcinfo.uid); } Dictionary <AttrType, float> unitAttrs = new Dictionary <AttrType, float>(); return(MapManager.Instance.SpawnEyeItemUnit(tag, dictionary, unitAttrs, newSpawnPoint, eyeItemInfoInst, eyeItemPreObjRes, controlType, false)); }
private void ShowOtherTargetInfo(Units other) { if (this.heroTargetInfo == null) { return; } this.SetOtherIndicatorActive(true); this.SetHeroIndicatorActive(false); if (this.heroName != other.name) { this.heroName = other.name; SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(other.npc_id); if (monsterMainData != null) { if (other.isTower) { if (other.TeamType == TeamType.LM) { this.otherIcon.spriteName = "TowerBlue_Avatar"; } else { this.otherIcon.spriteName = "TowerRed_Avatar"; } } else if (other.isHome) { if (other.TeamType == TeamType.LM) { this.otherIcon.spriteName = "GemBlue_Avatar"; } else { this.otherIcon.spriteName = "GemRed_Avatar"; } } else { this.otherIcon.spriteName = monsterMainData.avatar_icon; } this.otherName.text = LanguageManager.Instance.GetStringById(monsterMainData.name); } } this._monsterTarget.SetTarget(other); }
private void MonsterKilling() { Units triggerUnit = TriggerManager.GetTriggerUnit(); Units targetUnit = TriggerManager.GetTargetUnit(); if (triggerUnit && targetUnit && (targetUnit.CompareTag("Hero") || targetUnit.CompareTag("Player")) && triggerUnit.CompareTag("Monster")) { TeamType teamType = (TeamType)targetUnit.teamType; int unique_id = targetUnit.unique_id; string npc_id = targetUnit.npc_id; this.CheckRecords(teamType, unique_id, npc_id, string.Empty); this._allRecords[(int)teamType][unique_id].UpdateKillingMonsterData(); } SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(triggerUnit.npc_id); if (monsterMainData != null && monsterMainData.item_type == this._bossType) { TeamType teamType2 = (TeamType)targetUnit.teamType; AchieveData.UpdateEpicMonster(teamType2); } }
protected override void OnInit(bool isRebirth = false) { this.configMosterMainVo = BaseDataMgr.instance.GetMonsterMainData(this.npc_id); this.musicid = this.configMosterMainVo.music_id; AudioMgr.loadSoundBank_Skill(this.musicid, true, 0); if (this.configMosterMainVo == null) { ClientLogger.Warn("Ignore scaling, cannot found SysMonsterMainVo: " + this.npc_id); } else { this.DoScale(this.configMosterMainVo.scale); } base.OnInit(false); if (!base.IsMonsterCreep()) { } if (base.UnitType == UnitType.EyeUnit || base.IsMonsterCreep() || base.UnitType == UnitType.Soldier) { this.m_nServerVisibleState = 2; } }
public void BrocastAchievement(int attackId, int deathId, KillType killtype, List <int> helpers, int killWithTime, int killNoTime, string typeId) { Units units = null; if (attackId != 0) { units = MapManager.Instance.GetUnit(attackId); } Units unit = MapManager.Instance.GetUnit(deathId); if (unit == null) { ClientLogger.Error("Can't get units: " + deathId); return; } TeamType teamType = (TeamType)unit.teamType; int unique_id = unit.unique_id; string npc_id = unit.npc_id; bool flag = teamType != (TeamType)PlayerControlMgr.Instance.GetPlayer().teamType; if (attackId == 0) { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(typeId); if (monsterMainData != null) { int item_type = monsterMainData.item_type; EntityType attackerType = EntityType.None; string promptId = (!flag) ? "1100" : "1099"; if (Singleton <PvpManager> .Instance.IsObserver) { promptId = ((teamType != TeamType.BL) ? ((teamType != TeamType.LM) ? "1103" : "1102") : "1101"); } if (item_type == 1) { attackerType = EntityType.Monster; } else if (item_type == 3 || item_type == this._bossType) { attackerType = EntityType.Creep; } else if (item_type == 2 || item_type == 4) { attackerType = EntityType.Tower; } UIMessageBox.ShowKillPrompt(promptId, monsterMainData.npc_id, npc_id, attackerType, EntityType.None, string.Empty, string.Empty, units.TeamType, unit.TeamType); return; } UnityEngine.Debug.LogError("can't get monster data with type id:" + typeId); return; } else { if (units == null) { ClientLogger.Error("Can't get units: " + attackId); return; } this.IncHeroDeath(teamType); TeamType teamType2 = (TeamType)units.teamType; int unique_id2 = units.unique_id; string npc_id2 = units.npc_id; SysPromptVo dataById = BaseDataMgr.instance.GetDataById <SysPromptVo>("201"); if (dataById != null) { float icon_time = dataById.icon_time; } List <string> list = new List <string>(); if (helpers != null) { foreach (int current in helpers) { Units unit2 = MapManager.Instance.GetUnit(current); if (unit2 != null) { list.Add(unit2.npc_id); } else { ClientLogger.Error("can't get hero with id:" + current); } } } HUDModuleMsgTools.CallBattleMsg_SiderTipsModule_Kill(npc_id2, npc_id, flag, list, units.TeamType, unit.TeamType); AchieveData achieveData = new AchieveData(attackId, units.npc_id, (TeamType)units.teamType); AchieveData achieveData2 = new AchieveData(deathId, unit.npc_id, (TeamType)unit.teamType); achieveData2.unittype = units.tag; if (killtype == KillType.StopKill) { achieveData.CheckAchievemtCondition(achieveData, achieveData2, KillType.StopKill); return; } if (killtype == KillType.FirstBoold) { achieveData.ContinusKillNoTime = 1; achieveData.ContinusKillWithTime = 1; } else { achieveData.ContinusKillNoTime = killNoTime; achieveData.ContinusKillWithTime = killWithTime; } achieveData.CheckAchievemtCondition(achieveData, achieveData2, killtype); return; } }
public Units SpawnInstance(EntityVo npcinfo, string tag, TeamType teamType, int spawnPos, string respawnInterval = "[]", Transform newSpawnPoint = null, UnitControlType controlType = UnitControlType.None, UnitType unitType = UnitType.None) { if (npcinfo == null || npcinfo.npc_id == null || npcinfo.npc_id == string.Empty || tag == null) { ClientLogger.Error("SpawnInstance line 1 null"); return(null); } Dictionary <AttrType, float> dictionary = new Dictionary <AttrType, float>(); if (tag == "Hero" || tag == "Player") { string npc_id = npcinfo.npc_id; int level = npcinfo.level; int quality = npcinfo.quality; int star = npcinfo.star; float hp = npcinfo.hp; float mp = npcinfo.mp; SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(npc_id); if (heroMainData == null || heroMainData.model_id == null) { ClientLogger.Error("SpawnInstance: no hero found #" + npc_id); return(null); } Dictionary <DataType, object> dictionary2 = new Dictionary <DataType, object> { { DataType.NameId, npc_id }, { DataType.ModelId, heroMainData.model_id }, { DataType.TeamType, teamType }, { DataType.AIType, 2 }, { DataType.AttrFactor, SpawnUtility.GetAttrFactor(teamType, this._myScene) }, { DataType.Level, level }, { DataType.Quality, quality }, { DataType.Star, star }, { DataType.Skin, npcinfo.skin } }; if (npcinfo.uid != 0) { dictionary2.Add(DataType.UniqueId, npcinfo.uid); } if (hp != 0f) { dictionary.Add(AttrType.Hp, hp); } if (mp != 0f) { dictionary.Add(AttrType.Mp, mp); } Transform transform = newSpawnPoint; if (!transform) { transform = MapManager.Instance.GetSpawnPos(teamType, spawnPos); } Units result = MapManager.Instance.SpawnUnit(tag, dictionary2, dictionary, transform.position, transform.rotation, controlType, true, null, unitType); if (!transform) { ClientLogger.Error(string.Format("SpawnInstance: GetSpawnPos failed for {0} {1} in {2}", teamType, spawnPos, LevelManager.CurLevelId)); } return(result); } else if (tag.Equals("Home")) { string npc_id2 = npcinfo.npc_id; Transform transform2 = newSpawnPoint; if (!transform2) { transform2 = MapManager.Instance.GetSpawnPos(teamType, npcinfo.pos); } SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(npc_id2); if (monsterMainData == null) { ClientLogger.Error("SpawnInstance: no home found #" + npc_id2); return(null); } Dictionary <DataType, object> dictionary3 = new Dictionary <DataType, object> { { DataType.NameId, npc_id2 }, { DataType.ModelId, monsterMainData.model_id }, { DataType.TeamType, teamType }, { DataType.AIType, npcinfo.ai_type }, { DataType.AttrFactor, SpawnUtility.GetAttrFactor(teamType, this._myScene) }, { DataType.Skin, npcinfo.skin } }; if (npcinfo.uid != 0) { dictionary3.Add(DataType.UniqueId, npcinfo.uid); } return(MapManager.Instance.SpawnUnit(tag, dictionary3, dictionary, transform2.position, transform2.rotation, controlType, false, null, unitType)); } else { string npc_id3 = npcinfo.npc_id; Transform transform3 = newSpawnPoint; if (!transform3) { transform3 = MapManager.Instance.GetSpawnPos(teamType, npcinfo.pos); } SysMonsterMainVo monsterMainData2 = BaseDataMgr.instance.GetMonsterMainData(npc_id3); if (monsterMainData2 == null) { ClientLogger.Error("SpawnInstance: no npc found #" + npc_id3); return(null); } Dictionary <DataType, object> dictionary4 = new Dictionary <DataType, object> { { DataType.NameId, npc_id3 }, { DataType.ModelId, monsterMainData2.model_id }, { DataType.TeamType, teamType }, { DataType.AIType, npcinfo.ai_type }, { DataType.AttrFactor, SpawnUtility.GetAttrFactor(teamType, this._myScene) }, { DataType.Skin, npcinfo.skin } }; if (npcinfo.uid != 0) { dictionary4.Add(DataType.UniqueId, npcinfo.uid); } return(MapManager.Instance.SpawnUnit(tag, dictionary4, dictionary, transform3.position, transform3.rotation, controlType, false, null, unitType)); } }
public UIBloodBar CreateHudBar(Units player) { ClientLogger.AssertNotNull(player, null); if (player == null) { return(null); } if (!this.IsOpened) { CtrlManager.OpenWindow(WindowID.CharacterView, null); } this.TryShow(); UIBloodBar uIBloodBar; if (player.mHpBar) { uIBloodBar = player.mHpBar; } else { Transform hudBarParent = this.GetHudBarParent(player); if (player.isHero) { if (player.tag == "Player") { uIBloodBar = this._barRecycler.Create("MainHeroSlider", hudBarParent, player); } else { uIBloodBar = this._barRecycler.Create("HeroSlider", hudBarParent, player); } } else if (TagManager.CheckTag(player, global::TargetTag.EyeUnit)) { uIBloodBar = this._barRecycler.Create("EyeSlider", hudBarParent, player); } else if (player.isMonster) { if (player.isCreep) { uIBloodBar = this._barRecycler.Create("CreepSlider", hudBarParent, player); } else { if (player.UnitType == UnitType.Pet) { return(null); } if (player.UnitType == UnitType.SummonMonster) { uIBloodBar = this._barRecycler.Create("SummonerMonsterSlider", hudBarParent, player); } else { uIBloodBar = this._barRecycler.Create("MonsterSlider", hudBarParent, player); } } } else { if (!player.isTower && !player.isHome) { return(null); } uIBloodBar = this._barRecycler.Create("TowerSlider", hudBarParent, player); } uIBloodBar.name = player.name; uIBloodBar.SetTargetUnit(player); if (LevelManager.Instance.IsPvpBattleType && (player.isHero || player.isCreep)) { if (player.isHero) { uIBloodBar.ShowName(true, player.summonerName, player.unique_id); } else { SysMonsterMainVo monsterMainData = BaseDataMgr.instance.GetMonsterMainData(player.npc_id); uIBloodBar.ShowName(true, LanguageManager.Instance.GetStringById(monsterMainData.name), 0); } } else if (player.isHero && player.tag != "Player") { SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(player.npc_id); uIBloodBar.ShowName(true, LanguageManager.Instance.GetStringById(heroMainData.name) + LanguageManager.Instance.GetStringById("BattleAiText_Computer"), 0); } else if (player.isCreep) { SysMonsterMainVo monsterMainData2 = BaseDataMgr.instance.GetMonsterMainData(player.npc_id); uIBloodBar.ShowName(true, LanguageManager.Instance.GetStringById(monsterMainData2.name), 0); } else { uIBloodBar.ShowName(false, null, 0); } uIBloodBar.transform.localScale = player.surface.HudbarLocalScale; } uIBloodBar.UpdateHudBarType(player); return(uIBloodBar); }