/// <summary> /// Create a collection of item drops /// </summary> /// <param name="mapobject"></param> /// <param name="character"></param> /// <returns></returns> public static LootCollection Create(MapObject mapobject, Character character) { if (MapObject.IsPlayer(mapobject)) { throw new SystemException("Cannot create loot for mapobjects"); } LootCollection collection = new LootCollection(); PartySession party = character.sessionParty; if (party == null) { collection.LootLeader = character.id; } else if (party.LootSettings == 3 && party.ItemLeader.currentzone == mapobject.currentzone && mapobject.currentzone.IsInSightRangeBySquare(mapobject.Position, party.ItemLeader.Position)) { collection.LootLeader = party.ItemLeader.id; } else { collection.LootLeader = character.id; } // Generate loot from base mobs foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(mapobject.ModelId, character._DropRate)) { collection.Lootlist.Add(c); } //Item drops from quest content foreach (Rag2Item item in QuestBase.UserQuestLoot(mapobject.ModelId, character)) { collection.Lootlist.Add(item); } return(collection); }
//Monster Events #region Events public void Die(Character character) { lock (this) { //Clear current target this._target = null; character.ISONBATTLE = false; //Create loot collection by the killing character collection = LootCollection.Create(this, character); //Hand out experience of the killing character damagetable.GiveExperienceRewards(character, this, this._CEXP, this._JEXP, this._WEXP); //Elimination Objective killing character //QuestBase.UserEliminateTarget(this.ModelId, character); // Subscript myself as a corpse StopMovement(); } }
public bool GetLootCollection(Character target, out LootCollection collection) { collection = LootCollection.Create(this, target); return true; }
public bool GetLootCollection(Character target, out LootCollection collection) { throw new NotImplementedException(); }
public bool GetLootCollection(Character target, out LootCollection collection) { collection = this.collection; return((collection != null) ? collection.CanOpen(target) : false); }
/// <summary> /// Create a collection of item drops /// </summary> /// <param name="mapobject"></param> /// <param name="character"></param> /// <returns></returns> public static LootCollection Create(MapObject mapobject, Character character) { if (MapObject.IsPlayer(mapobject)) throw new SystemException("Cannot create loot for mapobjects"); LootCollection collection = new LootCollection(); PartySession party = character.sessionParty; if (party == null) { collection.LootLeader = character.id; } else if (party.LootSettings == 3 && party.ItemLeader.currentzone == mapobject.currentzone && mapobject.currentzone.IsInSightRangeBySquare(mapobject.Position, party.ItemLeader.Position)) { collection.LootLeader = party.ItemLeader.id; } else { collection.LootLeader = character.id; } // Generate loot from base mobs foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(mapobject.ModelId, character._DropRate)) { collection.Lootlist.Add(c); } //Item drops from quest content foreach (Rag2Item item in QuestBase.UserQuestLoot(mapobject.ModelId, character)) { collection.Lootlist.Add(item); } return collection; }
/// <summary> /// Occurs when the actor is spawned /// </summary> public override void OnSpawn() { //Get the z coordinate this.stance = (byte)StancePosition.Reborn; this.Position = this.currentzone.GetZ(this.Position); //Reload battlestatus Singleton.Templates.FillByTemplate(this.ModelId, this); //Set a random yaw this.Yaw = new Rotator((ushort)random.Next(0, ushort.MaxValue), 0); //Reload damage table damagetable = new DamageCollection(); //Dispose loot windo if (collection != null) collection.Dispose(); collection = null; }
/// <summary> /// Set's the initial spawn coords of the specified point. /// </summary> /// <param name="startpoint">Startpoint</param> public override void OnInitialize(Point startpoint) { this.RespawnOrigin = startpoint; //Create hate & damage table hatetable = new HateCollection(); damagetable = new DamageCollection(); //Clear collection table collection = null; //Load skill rotator string file = Server.SecurePath("~/mobskills/{0}.xml", this.ModelId); string defaultfile = Server.SecurePath("~/mobskills/default.xml"); if (File.Exists(file)) skills = SkillRotatorCollection.CreateFromFile(file); else if (File.Exists(defaultfile)) skills = SkillRotatorCollection.CreateFromFile(defaultfile); else skills = SkillRotatorCollection.Empty; //Call base base.OnInitialize(startpoint); }
public bool GetLootCollection(Character target, out LootCollection collection) { collection = this.collection; return (collection != null) ? collection.CanOpen(target) : false; }
public void Die(Character character) { lock (this) { //Clear current target this._target = null; character.ISONBATTLE = false; //Create loot collection by the killing character collection = LootCollection.Create(this, character); //Hand out experience of the killing character damagetable.GiveExperienceRewards(character, this, this._CEXP, this._JEXP, this._WEXP); //Elimination Objective killing character //QuestBase.UserEliminateTarget(this.ModelId, character); // Subscript myself as a corpse StopMovement(); } }