- Code: Select all
/*
* Created by Dean/Xaves
*/
#region Used
using System;
using System.Collections;
using System.Reflection;
using System.Threading;
using DOL.AI.Brain;
using DOL.Database;
using DOL.Language;
using DOL.GS.PacketHandler;
using log4net;
using System.Collections.Generic;
#endregion
namespace DEAN
{
public class BPRefund : Game.NPC
{
public override bool ReceiveItem(GameLiving source, InventoryItem item)
{
#region Refund
GamePlayer player = source as GamePlayer;
if (player == null || item == null) return true;
if (WorldMgr.GetDistance(this, player) > WorldMgr.INTERACT_DISTANCE)
{
player.Out.SendMessage("You are too far away you must stand closer " + GetName(0, false) + ".", eChatType.CT_System, eChatLoc.CL_SystemWindow);
return true;
}
if (!item.Name.Contains("null") && item.PoisonSpellID == 0)
{
long TotalBPAmount = BountyPointsValue;
player.GainBountyPoints((long)Math.Round((double)(TotalBPAmount / ServerProperties.Properties.BP_RATE * item.Count)));
player.Inventory.RemoveItem(item);
return true;
}
#endregion
return true;
}
}
}