/* This file was created with
Ilutzio's Questmaker. Enjoy! */
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Accounting; //Visam Added to get the account
namespace Server.Mobiles
{
[CorpseName("Bella's Corpse")]
public class Bella : Mobile
{
public virtual bool IsInvulnerable { get { return true; } }
[Constructable]
public Bella()
{
///////////STR/DEX/INT
InitStats(31, 41, 51);
///////////name
Name = "Bella";
///////////title
Title = "The Farmer";
///////////sex. 0x191 is female, 0x190 is male.
Body = 0x191;
///////////skincolor
Hue = Utility.RandomSkinHue();
///////////Random hair and haircolor
Utility.AssignRandomHair(this);
///////////clothing and hues
AddItem(new Server.Items.FancyShirt(Utility.RandomRedHue()));
AddItem(new Server.Items.Skirt(Utility.RandomNeutralHue()));
AddItem(new Server.Items.Sandals(Utility.RandomGreenHue()));
///////////immortal and frozen to-the-spot features below:
Blessed = true;
CantWalk = true;
///////////Adding a backpack
Container pack = new Backpack();
pack.DropItem(new Gold(250, 300));
pack.Movable = false;
AddItem(pack);
}
public Bella(Serial serial) : base(serial) { }
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
list.Add(new BellaEntry(from, this));
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public class BellaEntry : ContextMenuEntry
{
private Mobile m_Mobile;
private Mobile m_Giver;
public BellaEntry(Mobile from, Mobile giver) : base(6146, 3)
{
m_Mobile = from;
m_Giver = giver;
}
public override void OnClick()
{
if (!(m_Mobile is PlayerMobile))
return;
PlayerMobile mobile = (PlayerMobile)m_Mobile;
{
if (!mobile.HasGump(typeof(BellaQuestGump)))
{
mobile.SendGump(new BellaQuestGump(mobile));
}
}
}
}
public override bool OnDragDrop(Mobile from, Item dropped)
{
Mobile m = from;
PlayerMobile mobile = m as PlayerMobile;
Account acct=(Account)from.Account; //Visam added to get the account of the current char
bool BagOfFarmStuffBagRecieved = Convert.ToBoolean(acct.GetTag("BagOfFarmStuffBagRecieved")); //Visam added to add true/false value for checking if it's been done
if (mobile != null)
{
///////////item to be dropped
if (dropped is CowPatty && !BagOfFarmStuffBagRecieved) //Visam added account tag check
{
if (dropped.Amount != 15)
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There's not the right amount here!", mobile.NetState); return false;
}
dropped.Delete();
///////////the reward
mobile.AddToBackpack(new Gold(2000));
mobile.AddToBackpack(new BagOfFarmStuffBag());
///////////thanks message
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "There you go now go enjoy farm life.", mobile.NetState);
acct.SetTag( "BagOfFarmStuffBagRecieved", "true" ); // Visam add a tag to the player showing the quest has been completed
return true;
}
else if (dropped is Whip)
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, 1054071, mobile.NetState); return false;
}
else
{
this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState);
}
}
return false;
}
}
}