UO-Dev Arama


Yazar: Bilinmiyor
Tarih: 23-09-2009 16:57


Paylaş : Paylaş

Kod:
using System;
using Server;
using Server.Targeting;
using Server.Items;
using Server.Engines.Harvest;
using Server.Mobiles;
using Server.Engines.Quests;
using Server.Engines.Quests.Hag;

namespace Server.Targets
{
public class BladedItemTarget : Target
{
private Item m_Item;

public BladedItemTarget( Item item ) : base( 2, false, TargetFlags.None )
{
m_Item = item;
}

protected override void OnTargetOutOfRange( Mobile from, object targeted )
{
if ( targeted is UnholyBone && from.InRange( ((UnholyBone)targeted), 12 ) )
((UnholyBone)targeted).Carve( from, m_Item );
else
base.OnTargetOutOfRange (from, targeted);
}

protected override void OnTarget( Mobile from, object targeted )
{
if ( m_Item.Deleted )
return;

if ( targeted is ICarvable )
{
((ICarvable)targeted).Carve( from, m_Item );
}
else if ( targeted is SwampDragon && ((SwampDragon)targeted).HasBarding )
{
SwampDragon pet = (SwampDragon)targeted;

if ( !pet.Controlled || pet.ControlMaster != from )
from.SendLocalizedMessage( 1053022 ); // You cannot remove barding from a swamp dragon you do not own.
else
pet.HasBarding = false;
}
else
{
if ( targeted is StaticTarget )
{
int itemID = ((StaticTarget)targeted).ItemID;

if ( itemID == 0xD15 || itemID == 0xD16 ) // red mushroom
{
PlayerMobile player = from as PlayerMobile;

if ( player != null )
{
QuestSystem qs = player.Quest;

if ( qs is WitchApprenticeQuest )
{
FindIngredientObjective obj = qs.FindObjective( typeof( FindIngredientObjective ) ) as FindIngredientObjective;

if ( obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms )
{
player.SendLocalizedMessage( 1055036 ); // You slice a red cap mushroom from its stem.
obj.Complete();
return;
}
}
}
}
}

HarvestSystem system = Lumberjacking.System;
HarvestDefinition def = Lumberjacking.System.Definition;

int tileID;
Map map;
Point3D loc;

if ( !system.GetHarvestDetails( from, m_Item, targeted, out tileID, out map, out loc ) )
{
from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that!
}
else if ( !def.Validate( tileID ) )
{
from.SendLocalizedMessage( 500494 ); // You can't use a bladed item on that!
}
else
{
HarvestBank bank = def.GetBank( map, loc.X, loc.Y );

if ( bank == null )
return;

if ( bank.Current < 5 )
{
from.SendLocalizedMessage( 500493 ); // There's not enough wood here to harvest.
}
else
{
bank.Consume( 5, from );

Item item = new Kindling();

if ( from.PlaceInBackpack( item ) )
{
from.SendLocalizedMessage( 500491 ); // You put some kindling into your backpack.
from.SendLocalizedMessage( 500492 ); // An axe would probably get you more wood.
}
else
{
from.SendLocalizedMessage( 500490 ); // You can't place any kindling into your backpack!

item.Delete();
}
}
}
}
}
}
}



Yorumlar

Henüz yorum yapılmamıştır.

Oylamalar

Oylama :
Üyelerin oylama ortalaması (10 dışında) : Henüz Oylanmamış   
Oylar: 0

Benzer Sayfalar

SayfalarYorumlarGönderenTarih
Mulpatcher Ile Static Alanları Silme - Item ekleme0Mesh05-05-2011
Add New Animation Item Tutorial0TheRaskol19-03-2011
Add New Item Tutorial0Purgatory17-03-2011
Donate Item0tyr1020-07-2010
Pick Move Target0TheRaskol23-09-2009


Keywords:

ultima online, RunUO, ultima online download, sphere scripting, role play, uo grafik, second age ultima, uo loop, macroman, pvp server, server kurulumu, sphere, multool, ml mulls, 56b 55r 55i, htmlgumps, client 4x, client edit, sphere release, osi, rp server, sunucular, ghost mouse, inside uo, kingdom reborn, stygian abyss, uo nasıl oynanır, mondain's legacy, age of shadows, world build, grandmaster, ultima online pvp, player dosyaları, ultima online indir, frp game, RunUO 1.0.0, razor, uo rice, hue editör, skill tools, ultima online patch, axis, world build, verdata, verdata patcher, map editör, gump editör, mul patcher, aos mulls, scriptler, anim edit, anim publish, hues mul, hosting vps, event dialog, account sistemi, skill gain, static yapımı,