public Object(eObjectType a_eType, int a_nX, int a_nY, char a_cRender) { m_eType = a_eType; m_nX = a_nX; m_nY = a_nY; m_cRender = a_cRender; }
public void GenerateROG(GamePlayer player, eObjectType objectType, eSlot slot) { player.RemoveBountyPoints(2000); GameNPC mob = new GameNPC(); mob.Name = "Unique Object"; mob.CurrentRegionID = 1; mob.Level = (byte)(player.Level); if (mob.Level > 50) { mob.Level = 51; } LootList lootlist = new LootList(); ItemUnique item = null; item = new ItemUnique(); item.Object_Type = (int)objectType; item.Item_Type = (int)slot; mob.Level = 60; mob.Name = "TOA Mob"; mob.CurrentRegionID = 30; mob.Z = 9999; lootlist.AddFixed(LootGeneratorUniqueObject.GenerateUniqueItem(mob, player, item), 1); foreach (ItemUnique unique in lootlist.GetLoot()) { unique.Price = 0; GameServer.Database.AddObject(unique); InventoryItem invitem = GameInventoryItem.Create <ItemUnique>(unique); player.Inventory.AddItem(eInventorySlot.FirstEmptyBackpack, invitem); player.Out.SendMessage("Generated: " + unique.Name, eChatType.CT_System, eChatLoc.CL_SystemWindow); } }
public async void Confirm() { string ResultID = null; if (SelectIndex >= 0) { if (bCheckArtist && SearchInfo.Artists.Count > 0) { ResultID = SearchInfo.Artists[SelectIndex].ID.ToString(); ResultType = eObjectType.ARTIST; } if (bCheckAlbum && SearchInfo.Albums.Count > 0) { ResultID = SearchInfo.Albums[SelectIndex].ID.ToString(); ResultType = eObjectType.ALBUM; } if (bCheckTrack && SearchInfo.Tracks.Count > 0) { ResultID = SearchInfo.Tracks[SelectIndex].ID.ToString(); ResultType = eObjectType.TRACK; } if (bCheckVideo && SearchInfo.Videos.Count > 0) { ResultID = SearchInfo.Videos[SelectIndex].ID.ToString(); ResultType = eObjectType.VIDEO; } ShowWait = Visibility.Visible; await Task.Run(() => { ResultObject = TidalTool.tryGet(ResultID, out ResultType, ResultType); }); } RequestClose(); }
internal DecoderConfiguration(ref Reader reader) { var dcd = reader.readStructure <DecoderConfigDescriptor>(); objectType = (eObjectType)dcd.objectTypeIndication; streamType = (eStreamType)dcd.streamType; upStream = dcd.upStream; decodingBufferSize = dcd.bufferSizeDB; maximumBitrate = dcd.maxBitrate; averageBitrate = dcd.avgBitrate; // The reader gotta be positioned at the start of AudioSpecificConfig tag. // See ISO/IEC 14496-1 annex "E" for more info on tags and sizes. eDescriptorTag tag = (eDescriptorTag)reader.readByte(); if (tag != eDescriptorTag.DecoderSpecificInfo) { throw new ArgumentException($"Expected eDescriptorTag.DecoderSpecificInfo, got { tag } instead"); } int cb = reader.readSize(); if (reader.bytesLeft < cb) { throw new EndOfStreamException($"DecoderSpecificInfo has size { cb } in the header, yet the stream only has { reader.bytesLeft } unread bytes left"); } audioSpecificConfig = new byte[cb]; reader.readBytes(audioSpecificConfig.AsSpan()); }
public virtual void Use(eObjectType slotUsed, GameObject slot) { this.UpdateStatus(); this.usedSlot = slotUsed; if (slotUsed != eObjectType._NO_TYPE_) { this.RemovePrevious(slotUsed); GameData.Get.Data.Spots[(int)slotUsed - 1] = this.ItemDesc.Name; } if (ItemDesc.Type == TypeItem.Consommable || ItemDesc.Type == TypeItem.Assurance) { Monster.instance.OnObjectDropped(); } if (ItemDesc.Type == TypeItem.Meuble) { Monster.instance.OnHappyBecauseNewMeubleAdded(); } if (slot) { PlaceToSlot(slot); } }
public ObjectTable(eObjectType a_eType, int a_nPow, int a_nDef, int a_nHP) { m_nPow = a_nPow; m_nDef = a_nDef; m_nHP = a_nHP; m_eType = a_eType; }
public override bool Interact(GamePlayer player) { TurnTo(player, 500); string str = "Hello, I sell ROG for BP! Choose which object you wish to create!\n\n"; if (player.BountyPoints < 2000) { str += "It seems you do not have enough BP to use my service, you need atleast 2000!"; SendReply(player, str); return(false); } for (eObjectType i = eObjectType._FirstArmor; i <= eObjectType._LastArmor; i++) { if (i != eObjectType._FirstArmor) { str += "[" + i + "]\n"; } } for (eObjectType i = eObjectType._FirstWeapon; i <= eObjectType._LastWeapon; i++) { if (i != eObjectType._FirstWeapon) { str += "[" + i + "]\n"; } } SendReply(player, str); return(base.Interact(player)); }
public Hint(Vector2 position, eObjectType type) : base("", position, 40, type, 0) { name = nameList[type]; leftTop = new Object("Point", position - Vector2.One * 60, 30, type, teamNo); rightBottom = new Object("Point", position + Vector2.One * 60, 30, type, teamNo); }
/// public ObjectInfo() { m_GDObjId = CObjGlobal.InvalidObjID; m_eObjType = eObjectType.CT_MAXNUM; m_eObjState = eObjectState.CS_READY; m_ModelTypeIndex = ""; m_objClassType = default(Type); }
public MapObject(MapPoint pBasePoint, MapPoint[] pArea, string strObjectName, eObjectType eType) { BasePoint = pBasePoint; Area = pArea; strName = strObjectName; ObjectSpacificProperties = new Dictionary <string, string>(); this.Type = eType; }
public RelatedObject(eObjectType eot, long lObjectId, long lMultiStringId) { ExcpHelper.ThrowIf <InvalidOperationException>(eot == eObjectType.TaggedString, "Related object cannot be with type TaggedString"); this.ObjectType = eot; this.ObjectId = lObjectId; this.MultistringId = lMultiStringId; }
/// <summary> /// Updates the selected object, handles the swapping between foundations, pillars, etc. /// </summary> /// <param name="a_newIndex">The index of the new item you would like to swap to.</param> private void UpdateSelectedObject(int a_newIndex) { // Make sure we turn this last one off to prevent incorrect ghost displaying for the new item m_buildObjects[m_selectionIndex].hasInstantiatedPreview = false; // Update the preview object to match the new index. m_previewObject = m_buildObjects[a_newIndex].PreviewObject; m_curObjType = m_buildObjects[m_selectionIndex].ObjectType; }
public Object(string name, Vector2 position, float radius, eObjectType type, int teamNo = 0) { this.position = position; this.radius = radius; this.name = name; this.type = type; this.teamNo = teamNo; isMouseIn = false; }
public void SetRelation(eObjectType ot, long lObjectId) { Debug.Assert(lObjectId != 0); Debug.Assert(ot != eObjectType.TaggedString); this.Category = ot.ToString(); this.ObjectId = lObjectId; relationType = null; }
public DllistItem(int number, string name, eObjectType type) { Number = number; Check = true; Name = name; Type = type; Status = "Wait"; Data = null; }
/// <summary> /// /// </summary> /// <param name="strName"></param> /// <returns></returns> public MapObject GetRandomObjectByType(eObjectType objType) { XmlNodeList xndMapObjects = this.GetObjectsData().SelectNodes(".//Object[@Type='" + objType.ToString() + "']"); int iRandomIndex = Randomizer.rnd.Next(xndMapObjects.Count); return(ConvertXMLNodeToMapObject(xndMapObjects[iRandomIndex])); //return null; }
public MapObject(MapPoint pBasePoint, MapPoint[] pArea, string strObjectName, eObjectType eType, MapPoint[] pPathWays, int iObjectValue) { PathWays = pPathWays; BasePoint = pBasePoint; Area = pArea; strName = strObjectName; ObjectSpacificProperties = new Dictionary <string, string>(); this.Type = eType; iValue = iObjectValue; }
public override TaggedStringLn MergeLineObject(TaggedStringLn objSource) { lock (m_oLocker) { #if DEBUG if (m_di.ContainsKey(objSource.Id)) { TaggedStringLn strExisting = m_di[objSource.Id]; } #endif TaggedStringLn str = base.MergeLineObjectImp(objSource); if (str.IsRelated && str.RelationType != eObjectType.TaggedString) { eObjectType ot = str.RelationType; switch (ot) { case eObjectType.Group: m_diGroupStrings.AddRelatedString((long)str.ObjectId, str); break; case eObjectType.Competitor: m_diCompetitorStrings.AddRelatedString((long)str.ObjectId, str); break; case eObjectType.OddTranslation: m_diOddStrings.AddRelatedString((long)str.ObjectId, str); break; default: Debug.Assert(false); break; } } if (!m_diTaggedStrings2.ContainsKey(str.KeyName)) { IDictionary <string, TaggedStringLn> list = new Dictionary <string, TaggedStringLn>(); if (m_diTaggedStrings2.ContainsKey(str.Tag.ToLowerInvariant())) { list = m_diTaggedStrings2[str.Tag.ToLowerInvariant()]; } list[str.Language.ToLowerInvariant()] = str; m_diTaggedStrings2[str.Tag.ToLowerInvariant()] = list; } return(str); } }
/// <summary> /// Translates object type to compatible object types based on server type /// </summary> /// <param name="objectType">The object type</param> /// <returns>An array of compatible object types</returns> protected override eObjectType[] GetCompatibleObjectTypes(eObjectType objectType) { if (m_compatibleObjectTypes == null) { m_compatibleObjectTypes = new Hashtable(); m_compatibleObjectTypes[(int)eObjectType.Staff] = new[] { eObjectType.Staff }; m_compatibleObjectTypes[(int)eObjectType.Fired] = new[] { eObjectType.Fired }; m_compatibleObjectTypes[(int)eObjectType.MaulerStaff] = new[] { eObjectType.MaulerStaff }; m_compatibleObjectTypes[(int)eObjectType.FistWraps] = new[] { eObjectType.FistWraps }; // alb m_compatibleObjectTypes[(int)eObjectType.CrushingWeapon] = new[] { eObjectType.CrushingWeapon }; m_compatibleObjectTypes[(int)eObjectType.SlashingWeapon] = new[] { eObjectType.SlashingWeapon }; m_compatibleObjectTypes[(int)eObjectType.ThrustWeapon] = new[] { eObjectType.ThrustWeapon }; m_compatibleObjectTypes[(int)eObjectType.TwoHandedWeapon] = new[] { eObjectType.TwoHandedWeapon }; m_compatibleObjectTypes[(int)eObjectType.PolearmWeapon] = new[] { eObjectType.PolearmWeapon }; m_compatibleObjectTypes[(int)eObjectType.Flexible] = new[] { eObjectType.Flexible }; m_compatibleObjectTypes[(int)eObjectType.Longbow] = new[] { eObjectType.Longbow }; m_compatibleObjectTypes[(int)eObjectType.Crossbow] = new[] { eObjectType.Crossbow }; // TODO: case 5: abilityCheck = Abilities.Weapon_Thrown; break; // mid m_compatibleObjectTypes[(int)eObjectType.Hammer] = new[] { eObjectType.Hammer }; m_compatibleObjectTypes[(int)eObjectType.Sword] = new[] { eObjectType.Sword }; m_compatibleObjectTypes[(int)eObjectType.LeftAxe] = new[] { eObjectType.LeftAxe }; m_compatibleObjectTypes[(int)eObjectType.Axe] = new[] { eObjectType.Axe }; m_compatibleObjectTypes[(int)eObjectType.HandToHand] = new[] { eObjectType.HandToHand }; m_compatibleObjectTypes[(int)eObjectType.Spear] = new[] { eObjectType.Spear }; m_compatibleObjectTypes[(int)eObjectType.CompositeBow] = new[] { eObjectType.CompositeBow }; m_compatibleObjectTypes[(int)eObjectType.Thrown] = new[] { eObjectType.Thrown }; // hib m_compatibleObjectTypes[(int)eObjectType.Blunt] = new[] { eObjectType.Blunt }; m_compatibleObjectTypes[(int)eObjectType.Blades] = new[] { eObjectType.Blades }; m_compatibleObjectTypes[(int)eObjectType.Piercing] = new[] { eObjectType.Piercing }; m_compatibleObjectTypes[(int)eObjectType.LargeWeapons] = new[] { eObjectType.LargeWeapons }; m_compatibleObjectTypes[(int)eObjectType.CelticSpear] = new[] { eObjectType.CelticSpear }; m_compatibleObjectTypes[(int)eObjectType.Scythe] = new[] { eObjectType.Scythe }; m_compatibleObjectTypes[(int)eObjectType.RecurvedBow] = new[] { eObjectType.RecurvedBow }; m_compatibleObjectTypes[(int)eObjectType.Shield] = new[] { eObjectType.Shield }; m_compatibleObjectTypes[(int)eObjectType.Poison] = new[] { eObjectType.Poison }; // TODO: case 45: abilityCheck = Abilities.instruments; break; } eObjectType[] res = (eObjectType[])m_compatibleObjectTypes[(int)objectType]; if (res == null) { return(new eObjectType[0]); } return(res); }
public GameObject GetObjectByType(eObjectType type) { if (dicListObject.ContainsKey(type)) { return(dicListObject[type]); } #if UNITY_EDITOR Debug.Log("khong co trong list !!"); #endif return(null); }
public void SetNowTool(int index) { int nowIndex = index + 10 * pageNo; if (nowIndex >= (int)eObjectType.None) { return; } nowType = (eObjectType)nowIndex; Console.WriteLine(nowIndex); }
private void AddToItems(int iNumber, string sName, eObjectType sType) { for (int i = 0; i < Items.Count; i++) { if (sName == Items[i].Name) { return; } } Items.Add(new DllistItem(iNumber, sName, sType)); }
/// <summary> /// The type of each object assigned to the stage datum. /// </summary> /// <returns>eObjectType[].</returns> public eObjectType[] ToArrayObjectTypes() { eObjectType[] arrayItems = new eObjectType[_items.Count]; for (int i = 0; i < _items.Count; i++) { arrayItems[i] = _items[i].ObjectType; } return(arrayItems); }
public void ApplyWall(eObjectType a_eType) { if (a_eType == eObjectType.FireWall) { if (TableManager.Ins().GetObjTable(a_eType, out ObjectTable map) == false) { Console.WriteLine("arg error or check table"); return; } m_NowStat.m_nHP -= map.m_nHP; } }
public MapObject(MapPoint pBasePoint, MapPoint[] pArea, string strObjectName, eObjectType eType, MapPoint[] pPathWays, int iObjectValue, MapPoint mpAccessPoint, string strRotation, bool bShouldGuarded) { PathWays = pPathWays; BasePoint = pBasePoint; Area = pArea; strName = strObjectName; ObjectSpacificProperties = new Dictionary <string, string>(); this.Type = eType; iValue = iObjectValue; AccessPoint = mpAccessPoint; Rotation = strRotation; bShouldBeGuarded = bShouldGuarded; }
void Start() { // Set out intial index to 0 m_selectionIndex = 0; // Intialize the first object preview InitGhostPreview(); // Set the system to be active by default m_systemActive = true; m_curObjType = m_buildObjects[m_selectionIndex].ObjectType; }
public GameObject SpawnObjectByType(eObjectType type, Transform parent, ePoolName poolName) { GameObject objSpawn = GetObjectByType(type); SpawnPool pool = PoolManager.Pools[poolName.ToString()]; if (pool != null && objSpawn != null) { return(pool.Spawn(objSpawn, parent).gameObject); } #if UNITY_EDITOR Debug.Log("khong spawn duoc!"); #endif return(null); }
public bool DeleteGameObject(eObjectType DelObjectType, EAObjID _id) { if (CObjGlobal.InvalidObjID != _id) { EA_CObjectBase obj = null; switch (DelObjectType) { default: case eObjectType.CT_MYPLAYER: { break; } case eObjectType.CT_PLAYER: { obj = RemovePlayer(_id); break; } case eObjectType.CT_NPC: { obj = RemoveNPC(_id); break; } case eObjectType.CT_MONSTER: { obj = RemoveMob(_id); break; } case eObjectType.CT_ITEMOBJECT: { obj = RemoveItem(_id); break; } case eObjectType.CT_MAPOBJECT: { obj = RemoveMapObject(_id); } break; } RemoveEntity(obj); } return(false); }
public void CreatObject(eObjectType type, Vector2 position) { if ((int)type < 2) { mapPointsList[type].Add(creatFuncs[type](position)); } else if ((int)type >= 10) { creatFuncs[type](position); } else { entitysList.Add(creatFuncs[type](position)); } }
public void InitializeStage(int stageNo) { //初期化ルート List <List <Vector2> > bezierPoints = BezierStage.InitializeStage(Parameter.StageNo); for (int i = 0; i < bezierPoints.Count; i++) { for (int j = 0; j < bezierPoints[i].Count; j++) { CreatObjectFromData(eObjectType.BezierStage, bezierPoints[i][j], i); } } bezierManager.SetBezierPoints(bezierPoints); //初期化実体 entitysList.Clear(); CSVReader.Read("EntityPositionData_S" + stageNo); List <string[]> result = CSVReader.GetData(); for (int i = 0; i < result.Count; i++) { Vector2 position = new Vector2(int.Parse(result[i][1]), int.Parse(result[i][2])); eObjectType type = typeChange[result[i][0]]; entitysList.Add(new Object(result[i][0], position, 50, type)); } //初期化ヒント hintsList.Clear(); CSVReader.Read("HintsData_S" + stageNo); result = CSVReader.GetData(); for (int i = 0; i < result.Count; i++) { Hint hint = new Hint(new Vector2(int.Parse(result[i][1]), int.Parse(result[i][2])), Hint.NameToType(result[i][0])); Vector2 center = new Vector2(int.Parse(result[i][3]), int.Parse(result[i][4])); Vector2 size = new Vector2(int.Parse(result[i][5]), int.Parse(result[i][6])); hint.SetLeft(center - size / 2); hint.SetRight(center + size / 2); hintsList.Add(new List <Object>()); int lastOne = hintsList.Count - 1; hintsList[lastOne].Add(hint); hintsList[lastOne].Add(hint.GetLeftTop()); hintsList[lastOne].Add(hint.GetRightBottom()); } }
/// <summary> /// Check an Object_Type to determine if it's a Bow weapon /// </summary> /// <param name="objectType"></param> /// <returns></returns> public static bool IsBowWeapon(eObjectType objectType) { return (objectType == eObjectType.CompositeBow || objectType == eObjectType.Longbow || objectType == eObjectType.RecurvedBow); }
public ObjectInfo(eObjectType type, string name, byte level) { this.type = type; this.name = name; this.level = level; }
private static void WriteMeleeResists(eRealm realm, eObjectType armorType, int slash, int crush, int thrust) { if (realm < eRealm._First || realm > eRealm._LastPlayerRealm) throw new ArgumentOutOfRangeException("realm", realm, "Realm should be between _First and _LastPlayerRealm."); if (armorType < eObjectType._FirstArmor || armorType > eObjectType._LastArmor) throw new ArgumentOutOfRangeException("armorType", armorType, "Armor type should be between _FirstArmor and _LastArmor"); int off = (realm - eRealm._First) << (DAMAGETYPE_BITCOUNT + ARMORTYPE_BITCOUNT); off |= (armorType - eObjectType._FirstArmor) << DAMAGETYPE_BITCOUNT; m_armorResists[off + (eDamageType.Slash - eDamageType._FirstResist)] = slash; m_armorResists[off + (eDamageType.Crush - eDamageType._FirstResist)] = crush; m_armorResists[off + (eDamageType.Thrust - eDamageType._FirstResist)] = thrust; }
private static void WriteMagicResists(eRealm realm, eObjectType armorType, int heat, int cold, int matter, int energy) { if (realm < eRealm._First || realm > eRealm._LastPlayerRealm) throw new ArgumentOutOfRangeException("realm", realm, "Realm should be between _First and _LastPlayerRealm."); if (armorType < eObjectType._FirstArmor || armorType > eObjectType._LastArmor) throw new ArgumentOutOfRangeException("armorType", armorType, "Armor type should be between _FirstArmor and _LastArmor"); int off = (realm - eRealm._First) << (DAMAGETYPE_BITCOUNT + ARMORTYPE_BITCOUNT); off |= (armorType - eObjectType._FirstArmor) << DAMAGETYPE_BITCOUNT; m_armorResists[off + (eDamageType.Heat - eDamageType._FirstResist)] = heat; m_armorResists[off + (eDamageType.Cold - eDamageType._FirstResist)] = cold; m_armorResists[off + (eDamageType.Matter - eDamageType._FirstResist)] = matter; m_armorResists[off + (eDamageType.Energy - eDamageType._FirstResist)] = energy; }
/// <summary> /// Translates object type to compatible object types based on server type /// </summary> /// <param name="objectType">The object type</param> /// <returns>An array of compatible object types</returns> protected override eObjectType[] GetCompatibleObjectTypes(eObjectType objectType) { if (m_compatibleObjectTypes == null) { m_compatibleObjectTypes = new Hashtable(); m_compatibleObjectTypes[(int)eObjectType.Staff] = new eObjectType[] { eObjectType.Staff }; m_compatibleObjectTypes[(int)eObjectType.Fired] = new eObjectType[] { eObjectType.Fired }; m_compatibleObjectTypes[(int)eObjectType.MaulerStaff] = new eObjectType[] { eObjectType.MaulerStaff }; m_compatibleObjectTypes[(int)eObjectType.FistWraps] = new eObjectType[] { eObjectType.FistWraps }; //alb m_compatibleObjectTypes[(int)eObjectType.CrushingWeapon] = new eObjectType[] { eObjectType.CrushingWeapon }; m_compatibleObjectTypes[(int)eObjectType.SlashingWeapon] = new eObjectType[] { eObjectType.SlashingWeapon }; m_compatibleObjectTypes[(int)eObjectType.ThrustWeapon] = new eObjectType[] { eObjectType.ThrustWeapon }; m_compatibleObjectTypes[(int)eObjectType.TwoHandedWeapon] = new eObjectType[] { eObjectType.TwoHandedWeapon }; m_compatibleObjectTypes[(int)eObjectType.PolearmWeapon] = new eObjectType[] { eObjectType.PolearmWeapon }; m_compatibleObjectTypes[(int)eObjectType.Flexible] = new eObjectType[] { eObjectType.Flexible }; m_compatibleObjectTypes[(int)eObjectType.Longbow] = new eObjectType[] { eObjectType.Longbow }; m_compatibleObjectTypes[(int)eObjectType.Crossbow] = new eObjectType[] { eObjectType.Crossbow }; //TODO: case 5: abilityCheck = Abilities.Weapon_Thrown; break; //mid m_compatibleObjectTypes[(int)eObjectType.Hammer] = new eObjectType[] { eObjectType.Hammer }; m_compatibleObjectTypes[(int)eObjectType.Sword] = new eObjectType[] { eObjectType.Sword }; m_compatibleObjectTypes[(int)eObjectType.LeftAxe] = new eObjectType[] { eObjectType.LeftAxe }; m_compatibleObjectTypes[(int)eObjectType.Axe] = new eObjectType[] { eObjectType.Axe }; m_compatibleObjectTypes[(int)eObjectType.HandToHand] = new eObjectType[] { eObjectType.HandToHand }; m_compatibleObjectTypes[(int)eObjectType.Spear] = new eObjectType[] { eObjectType.Spear }; m_compatibleObjectTypes[(int)eObjectType.CompositeBow] = new eObjectType[] { eObjectType.CompositeBow }; m_compatibleObjectTypes[(int)eObjectType.Thrown] = new eObjectType[] { eObjectType.Thrown }; //hib m_compatibleObjectTypes[(int)eObjectType.Blunt] = new eObjectType[] { eObjectType.Blunt }; m_compatibleObjectTypes[(int)eObjectType.Blades] = new eObjectType[] { eObjectType.Blades }; m_compatibleObjectTypes[(int)eObjectType.Piercing] = new eObjectType[] { eObjectType.Piercing }; m_compatibleObjectTypes[(int)eObjectType.LargeWeapons] = new eObjectType[] { eObjectType.LargeWeapons }; m_compatibleObjectTypes[(int)eObjectType.CelticSpear] = new eObjectType[] { eObjectType.CelticSpear }; m_compatibleObjectTypes[(int)eObjectType.Scythe] = new eObjectType[] { eObjectType.Scythe }; m_compatibleObjectTypes[(int)eObjectType.RecurvedBow] = new eObjectType[] { eObjectType.RecurvedBow }; m_compatibleObjectTypes[(int)eObjectType.Shield] = new eObjectType[] { eObjectType.Shield }; m_compatibleObjectTypes[(int)eObjectType.Poison] = new eObjectType[] { eObjectType.Poison }; //TODO: case 45: abilityCheck = Abilities.instruments; break; } eObjectType[] res = (eObjectType[])m_compatibleObjectTypes[(int)objectType]; if (res == null) return new eObjectType[0]; return res; }
/// <summary> /// Get object specialization level based on server type /// </summary> /// <param name="player">player whom specializations are checked</param> /// <param name="objectType">object type</param> /// <returns>specialization in object or 0</returns> public virtual int GetObjectSpecLevel(GamePlayer player, eObjectType objectType) { int res = 0; foreach (eObjectType obj in GetCompatibleObjectTypes(objectType)) { int spec = player.GetModifiedSpecLevel(SkillBase.ObjectTypeToSpec(obj)); if (res < spec) res = spec; } return res; }
/// <summary> /// Checks whether one object type is equal to another /// based on server type /// </summary> /// <param name="type1"></param> /// <param name="type2"></param> /// <returns>true if equals</returns> public virtual bool IsObjectTypesEqual(eObjectType type1, eObjectType type2) { foreach (eObjectType obj in GetCompatibleObjectTypes(type1)) { if (obj == type2) return true; } return false; }
/// <summary> /// Convert object type to spec needed to use that object /// </summary> /// <param name="objectType">type of the object</param> /// <returns>spec names needed to use that object type</returns> public static string ObjectTypeToSpec(eObjectType objectType) { string res = null; if (!m_objectTypeToSpec.TryGetValue(objectType, out res)) if (log.IsWarnEnabled) log.Warn("Not found spec for object type " + objectType); return res; }