|
.using System;
using Server;
using System.Collections;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Scripts.Commands
{
public class HueTarget
{
int m_Hue;
public static void Initialize()
{
Server.Commands.Register("Hue", AccessLevel.Player, new CommandEventHandler( Hue_OnCommand ) );
}
[Usage("Hue")]
public static void Hue_OnCommand( CommandEventArgs e)
{
if (e.Length >= 1)
e.Mobile.Target = new HueTarget(e.GetInt32(0));
}
public HueTarget(int hue)
: base(-1, false, TargetFlags.None)
{
m_Hue = hue;
}
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature
{
Gold m_Gold = (Gold)from.Backpack.FindItemByType(typeof(Gold));
Gold b_Gold = (Gold)from.BankBox.FindItemByType(typeof(Gold));
int m_Amount = from.Backpack.GetAmount(typeof(Gold));
int b_Amount = from.BankBox.GetAmount(typeof(Gold));
if (target is BaseJewel || target is BaseArmor || target is BaseClothing || target is BaseShield || target is BaseWeapon || target is EtherealMount || target is BaseSuit)
{
if (m_Hue > -1 && m_Hue < 2000)
{
Item item = (Item)target;
if (m_Amount >= 2000)
{
if (item.RootParent == from) // Make sure its in their pack or they are wearing it
{
item.Hue = m_Hue;
from.Backpack.ConsumeTotal(typeof(Gold), 10000); // Para Silindi
from.SendMessage("Boyadiginiz Item Karsiliginda Bankanizdan 10000 Gold Alinmistir.");
}
}
else if (b_Amount >= 2000)
{
if (item.RootParent == from) // Make sure its in their pack or they are wearing it
{
item.Hue = m_Hue;
from.BankBox.ConsumeTotal(typeof(Gold), 10000); // Para Silindi
from.SendMessage("Boyadiginiz Item Karsiliginda Bankanizdan 10000 Gold Alinmistir.");
}
}
else
{
from.SendMessage("Bankanizda 10000 Gold Bulunmamaktadir.");
}
}
else
{
from.SendMessage("0-2000 Arasi Bir Sayi Girmelisiniz.");
}
}
}
}
}Yardımcı Olursanız çok sevinirim arkadaşlar Şimdiden Teşekkürler.
strOffs = AosAttributes.GetValue( this, AosAttribute.BonusHits ); (bu yazıyı gördüğünüz anda (strOffs = AosAttributes)yazısının arasınaki = in arkasında + olması lazım) yanistrOffs += AosAttributes.GetValue( this, AosAttribute.BonusHits );Böyle olduğu zaman runuo 1.0 daki Str'nin verdiği hp bonusu Runuo 2.0 ve üstleri için ayarlamış oluyoruz...
using System;
using Server;
using System.Collections;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Commands;
namespace Server.Misc
{
public class HueTarget
{
int m_Hue;
public static void Initialize()
{
CommandSystem.Register("Hue", AccessLevel.Player, new CommandEventHandler( Hue_OnCommand ) );
}
[Usage("Hue")]
public static void Hue_OnCommand( CommandEventArgs e)
{
if (e.Length >= 1)
e.Mobile.Target = new HueTarget(e.GetInt32(0));
}
public HueTarget(int hue)
: base(-1, false, TargetFlags.None)
{
m_Hue = hue;
}
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature
{
Gold m_Gold = (Gold)from.Backpack.FindItemByType(typeof(Gold));
Gold b_Gold = (Gold)from.BankBox.FindItemByType(typeof(Gold));
int m_Amount = from.Backpack.GetAmount(typeof(Gold));
int b_Amount = from.BankBox.GetAmount(typeof(Gold));
if (target is BaseJewel || target is BaseArmor || target is BaseClothing || target is BaseShield || target is BaseWeapon || target is EtherealMount || target is BaseSuit)
{
if (m_Hue > -1 && m_Hue < 2000)
{
Item item = (Item)target;
if (m_Amount >= 2000)
{
if (item.RootParent == from) // Make sure its in their pack or they are wearing it
{
item.Hue = m_Hue;
from.Backpack.ConsumeTotal(typeof(Gold), 10000); // Para Silindi
from.SendMessage("Boyadiginiz Item Karsiliginda Bankanizdan 10000 Gold Alinmistir.");
}
}
else if (b_Amount >= 2000)
{
if (item.RootParent == from) // Make sure its in their pack or they are wearing it
{
item.Hue = m_Hue;
from.BankBox.ConsumeTotal(typeof(Gold), 10000); // Para Silindi
from.SendMessage("Boyadiginiz Item Karsiliginda Bankanizdan 10000 Gold Alinmistir.");
}
}
else
{
from.SendMessage("Bankanizda 10000 Gold Bulunmamaktadir.");
}
}
else
{
from.SendMessage("0-2000 Arasi Bir Sayi Girmelisiniz.");
}
}
}
}
}Bunu kullan Diğer sorunun cevabını birazdan vereceğim.
|
|
| Konu | Kategori | Son cevap | Son yazan | Mesaj | Görüntüleme | |
|---|---|---|---|---|---|---|
|
|
Random Spawn sistemi yardım
Son cevap: 02-09 16:44 · Son yazan: Stark35 · Mesaj: 12 · Görüntü: 6153
|
Derleme Scriptler | 02-09 16:44 | 12 | 6153 | |
|
|
Erlik UO II RunUO - ServUO
Son cevap: 24-01 20:38 · Son yazan: TheRaskol · Mesaj: 2 · Görüntü: 1806
|
Server Reklam, Tartışma | 24-01 20:38 | 2 | 1806 | |
|
|
Erlik UO PVP Shard (RunUO)
Son cevap: 14-04 01:11 · Son yazan: alonerapper58 · Mesaj: 1 · Görüntü: 2253
|
Server Reklam, Tartışma | 14-04 01:11 | 1 | 2253 | |
|
|
Server Açma Konusunda Yardım
Son cevap: 20-02 18:37 · Son yazan: Daedhelon · Mesaj: 14 · Görüntü: 7496
|
UO Yardım Alanı | 20-02 18:37 | 14 | 7496 | |
|
|
Debug hata yardım.
Son cevap: 28-09 18:30 · Son yazan: Gokku · Mesaj: 3 · Görüntü: 2407
|
Konsol Hataları | 28-09 18:30 | 3 | 2407 |