using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class ResurrectionTarget : Target
{
private PetResurrectionDeed m_Deed;
public ResurrectionTarget( PetResurrectionDeed deed ) : base( 1, false, TargetFlags.None )
{
m_Deed = deed;
}
protected override void OnTarget( Mobile from, object target )
{
if ( target is BaseCreature )
{
BaseCreature t = ( BaseCreature ) target;
if ( t.IsDeadPet == false )
{
from.SendMessage( "That pet is already living!" );
}
else if ( t.ControlMaster != from )
{
from.SendMessage( "That is not your pet!" );
}
else
{
t.IsDeadPet = !t.IsDeadPet;
from.SendMessage( "You bring your pet back to life!" );
t.PlaySound( 0x214 );
t.FixedEffect( 0x376A, 10, 16 );
m_Deed.Delete(); // Delete the deed
}
}
else
{
from.SendMessage( "That is not a valid traget." );
}
}
}
public class PetResurrectionDeed : Item // Create the item class which is derived from the base item class
{
[Constructable]
public PetResurrectionDeed() : base( 0x14F0 )
{
Weight = 1.0;
Name = "a pet Resurrection deed";
LootType = LootType.Blessed;
Hue = 2216;
}
public PetResurrectionDeed( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
LootType = LootType.Blessed;
int version = reader.ReadInt();
}
public override bool DisplayLootType{ get{ return false; } }
public override void OnDoubleClick( Mobile from ) // Override double click of the deed to call our target
{
if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.SendMessage( "Choose the pet you wish to bring back to life." );
from.Target = new ResurrectionTarget( this ); // Call our target
}
}
}
}
Total votes: 0
Ultima Online 1 hafta önce
Sunucular 2 hafta önce
Duyurular 3 hafta önce
Sphere Scripting 4 hafta önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Diğer Oyunlar 1 ay önce
Sunucular 1 ay önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Ultima Online 2 ay önce
Ultima Online 2 ay önce
2024-10-31 22:47
2024-10-14 17:45
2024-09-26 14:21
2024-07-08 22:50
2024-07-08 22:34
2024-06-19 22:05
2024-06-01 02:19
2024-05-31 21:17
Yorumlar (0)