Skip to content

Commit

Permalink
Merge pull request #1762 from Argalep/master
Browse files Browse the repository at this point in the history
Exploring The Deep Quest Mobile dropQuest Item Fix
  • Loading branch information
kevin-10 committed Feb 20, 2017
2 parents 0afa122 + e783302 commit a725455
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 57 deletions.
29 changes: 20 additions & 9 deletions Scripts/Services/ExploringTheDeep/Mobiles/Djinn.cs
@@ -1,6 +1,9 @@
using System;
using Server.Items;
using System.Collections;
using Server.Engines.Quests;
using System.Collections.Generic;
using System.Linq;

namespace Server.Mobiles
{
Expand Down Expand Up @@ -55,23 +58,31 @@ public Djinn()
this.m_Timer.Start();
}

public override bool OnBeforeDeath()
public override void OnDeath(Container c)
{
Mobile killer = DemonKnight.FindRandomPlayer(this);
List<DamageStore> rights = GetLootingRights();

if (killer != null)
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
{
Item item = new AquaGem();
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;

Container pack = killer.Backpack;
if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent)
{
Item item = new AquaGem();

if (pack == null || !pack.TryDropItem(killer, item, false))
killer.BankBox.DropItem(item);
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
{
m.BankBox.DropItem(item);
}

killer.SendLocalizedMessage(1154489); // You received a Quest Item!
m.SendLocalizedMessage(1154489); // You received a Quest Item!
}
}
}

return base.OnBeforeDeath();
base.OnDeath(c);
}

public static Djinn Spawn(Point3D platLoc, Map platMap)
Expand Down
31 changes: 21 additions & 10 deletions Scripts/Services/ExploringTheDeep/Mobiles/IceWyrm.cs
@@ -1,6 +1,9 @@
using System;
using Server.Items;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Server.Engines.Quests;

namespace Server.Mobiles
{
Expand Down Expand Up @@ -58,23 +61,31 @@ protected override void OnTick()
}
}

public override bool OnBeforeDeath()
public override void OnDeath(Container c)
{
Mobile killer = DemonKnight.FindRandomPlayer(this);
List<DamageStore> rights = GetLootingRights();

if (killer != null)
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
{
Item item = new IceWyrmScale();
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;

Container pack = killer.Backpack;
if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CusteauPerron)
{
Item item = new IceWyrmScale();

if (pack == null || !pack.TryDropItem(killer, item, false))
killer.BankBox.DropItem(item);
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
{
m.BankBox.DropItem(item);
}

killer.SendLocalizedMessage(1154489); // You received a Quest Item!
}
m.SendLocalizedMessage(1154489); // You received a Quest Item!
}
}
}

return base.OnBeforeDeath();
base.OnDeath(c);
}

public override bool ReacquireOnMovement { get { return true; } }
Expand Down
73 changes: 57 additions & 16 deletions Scripts/Services/ExploringTheDeep/Mobiles/MercutioTheUnsavory.cs
@@ -1,64 +1,100 @@
using System;
using Server.Items;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Quests;
using System.Linq;

namespace Server.Mobiles
{
[CorpseName("a mercutio corpse")]
public class MercutioTheUnsavory : Brigand
public class MercutioTheUnsavory : BaseCreature
{
private static readonly ArrayList m_Instances = new ArrayList();
public static ArrayList Instances { get { return m_Instances; } }

[Constructable]
public MercutioTheUnsavory()
: base()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
m_Instances.Add(this);

this.Body = 0x190;
this.Hue = Utility.RandomSkinHue();
this.Name = "Mercutio";
this.Title = "The Unsavory";
this.Female = false;

this.SetStr(120, 150);
this.SetStr(1000, 1300);
this.SetDex(101, 125);
this.SetInt(61, 75);
this.Hits = 200;

this.SetDamage(11, 24);

this.SetDamageType(ResistanceType.Physical, 100);

this.SetResistance(ResistanceType.Physical, 10, 15);
this.SetResistance(ResistanceType.Fire, 10, 15);
this.SetResistance(ResistanceType.Poison, 10, 15);
this.SetResistance(ResistanceType.Energy, 10, 15);

this.SetSkill(SkillName.Fencing, 106.0, 117.5);
this.SetSkill(SkillName.Macing, 105.0, 117.5);
this.SetSkill(SkillName.MagicResist, 50.0, 90.5);
this.SetSkill(SkillName.Swords, 105.0, 117.5);
this.SetSkill(SkillName.Parry, 105.0, 117.5);
this.SetSkill(SkillName.Tactics, 105.0, 117.5);
this.SetSkill(SkillName.Wrestling, 55.0, 87.5);

this.Fame = 3000;
this.Karma = -3000;
this.Karma = -3000;

this.AddImmovableItem(new MercutiosCutlass());
this.AddItem(new ChainChest());
this.AddItem(Loot.RandomShield());
this.AddItem(new ShortPants(Utility.RandomNeutralHue()));
this.AddItem(new Boots(Utility.RandomNeutralHue()));

Utility.AssignRandomHair(this);

Timer SelfDeleteTimer = new InternalSelfDeleteTimer(this);
SelfDeleteTimer.Start();
}

private void AddImmovableItem(Item item)
{
item.LootType = LootType.Blessed;
AddItem(item);
}

public override bool ClickTitle { get { return false; } }
public override bool AlwaysMurderer { get { return true; } }

public override bool OnBeforeDeath()
public override void OnDeath(Container c)
{
Mobile killer = DemonKnight.FindRandomPlayer(this);
List<DamageStore> rights = GetLootingRights();

if (killer != null)
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
{
Item item = new MercutiosCutlass();
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;

Container pack = killer.Backpack;
if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent)
{
Item item = new MercutiosCutlass();

if (pack == null || !pack.TryDropItem(killer, item, false))
killer.BankBox.DropItem(item);
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
{
m.BankBox.DropItem(item);
}

killer.SendLocalizedMessage(1154489); // You received a Quest Item!
m.SendLocalizedMessage(1154489); // You received a Quest Item!
}
}
}

return base.OnBeforeDeath();
base.OnDeath(c);
}

public static MercutioTheUnsavory Spawn(Point3D platLoc, Map platMap)
Expand All @@ -78,7 +114,12 @@ public MercutioTheUnsavory(Serial serial)
: base(serial)
{
}


public override void GenerateLoot()
{
this.AddLoot(LootPack.Average);
}

public class InternalSelfDeleteTimer : Timer
{
private MercutioTheUnsavory Mare;
Expand Down Expand Up @@ -145,7 +186,7 @@ public void SpawnBrigand(Mobile target)

for (int i = 0; i < newBrigands; ++i)
{
BaseCreature brigand = new Brigand();
BaseCreature brigand = new HumanBrigand();

brigand.Team = this.Team;

Expand Down
31 changes: 21 additions & 10 deletions Scripts/Services/ExploringTheDeep/Mobiles/ObsidianWyvern.cs
@@ -1,6 +1,9 @@
using System;
using Server.Items;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Quests;
using System.Linq;

namespace Server.Mobiles
{
Expand Down Expand Up @@ -86,24 +89,32 @@ protected override void OnTick()
}
}

public override bool OnBeforeDeath()
public override void OnDeath(Container c)
{
Mobile killer = DemonKnight.FindRandomPlayer(this);
List<DamageStore> rights = GetLootingRights();

if (killer != null)
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
{
Item item = new WillemHartesHat();
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;

Container pack = killer.Backpack;
if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent)
{
Item item = new WillemHartesHat();

if (pack == null || !pack.TryDropItem(killer, item, false))
killer.BankBox.DropItem(item);
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
{
m.BankBox.DropItem(item);
}

killer.SendLocalizedMessage(1154489); // You received a Quest Item!
m.SendLocalizedMessage(1154489); // You received a Quest Item!
}
}
}

return base.OnBeforeDeath();
}
base.OnDeath(c);
}

public override bool HasBreath { get { return true; } }
public override bool ReacquireOnMovement { get { return true; } }
Expand Down
35 changes: 23 additions & 12 deletions Scripts/Services/ExploringTheDeep/Mobiles/OrcEngineer.cs
@@ -1,6 +1,9 @@
using Server.Items;
using Server.Engines.Quests;
using Server.Items;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace Server.Mobiles
{
Expand Down Expand Up @@ -77,24 +80,32 @@ protected override void OnTick()
}
}
}
public override bool OnBeforeDeath()

public override void OnDeath(Container c)
{
Mobile killer = DemonKnight.FindRandomPlayer(this);
List<DamageStore> rights = GetLootingRights();

if (killer != null)
foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
{
Item item = new OrcishSchematics();
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;

Container pack = killer.Backpack;
if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent)
{
Item item = new OrcishSchematics();

if (pack == null || !pack.TryDropItem(killer, item, false))
killer.BankBox.DropItem(item);
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
{
m.BankBox.DropItem(item);
}

killer.SendLocalizedMessage(1154489); // You received a Quest Item!
m.SendLocalizedMessage(1154489); // You received a Quest Item!
}
}
}
return base.OnBeforeDeath();

base.OnDeath(c);
}

public override void OnAfterDelete()
Expand Down

0 comments on commit a725455

Please sign in to comment.