本文整理汇总了C#中Server.Items.Gold.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# Gold.Delete方法的具体用法?C# Gold.Delete怎么用?C# Gold.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.Gold
的用法示例。
在下文中一共展示了Gold.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if( m_Placer == null || m_Placer.Deleted )
m_Placer = from;
if( from.InRange( this.GetWorldLocation(), 10 ) )
{
if( m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster )
{
Container c = m_Placer.Backpack;
Gold t = new Gold( m_Value );
if( c.TryDropItem( m_Placer, t, true ) )
{
this.Delete();
m_Placer.SendMessage( "The item disolves and gives you a refund" );
}
else
{
t.Delete();
m_Placer.SendMessage("For some reason, the refund didn't work! Please page a GM");
}
}
else
{
from.SendMessage( "Stay out of my yard!" );
}
}
else
{
from.SendMessage( "The item is too far away" );
}
}
示例2: OnClick
public override void OnClick()
{
Container c = m_From.Backpack;
Gold t = new Gold( value );
if( c.TryDropItem( m_From, t, true ) )
{
m_Stair.Delete();
m_From.SendMessage( "The item disolves and gives you a refund" );
}
else
{
t.Delete();
m_From.SendMessage("For some reason, the refund didn't work! Please page a GM");
}
}
示例3: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
BankBox box = from.FindBankNoCreate();
if ( box != null && IsChildOf( box ) )
{
Delete();
int deposited = 0;
int toAdd = m_Worth;
Gold gold;
while ( toAdd > 60000 )
{
gold = new Gold( 60000 );
if ( box.TryDropItem( from, gold, false ) )
{
toAdd -= 60000;
deposited += 60000;
}
else
{
gold.Delete();
from.AddToBackpack( new BankCheck( toAdd ) );
toAdd = 0;
break;
}
}
if ( toAdd > 0 )
{
gold = new Gold( toAdd );
if ( box.TryDropItem( from, gold, false ) )
{
deposited += toAdd;
}
else
{
gold.Delete();
from.AddToBackpack( new BankCheck( toAdd ) );
}
}
// Gold was deposited in your account:
from.SendLocalizedMessage( 1042672, true, " " + deposited.ToString() );
}
else
{
from.SendLocalizedMessage( 1047026 ); // That must be in your bank box to use it.
}
}
示例4: OnGoldGiven
public virtual bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( CheckTeachingMatch( from ) )
{
if ( Teach( m_Teaching, from, dropped.Amount, true ) )
{
dropped.Delete();
return true;
}
}
else if ( IsHumanInTown() )
{
Direction = GetDirectionTo( from );
int oldSpeechHue = this.SpeechHue;
this.SpeechHue = 0x23F;
SayTo( from, "Thou art giving me gold?" );
if ( dropped.Amount >= 400 )
SayTo( from, "'Tis a noble gift." );
else
SayTo( from, "Money is always welcome." );
this.SpeechHue = 0x3B2;
SayTo( from, 501548 ); // I thank thee.
this.SpeechHue = oldSpeechHue;
dropped.Delete();
return true;
}
return false;
}
示例5: RefundForVine
public static bool RefundForVine( Mobile m_From )
{
Container c = m_From.Backpack;
Gold t = new Gold( ( m_VinePrice ) );
if( c.TryDropItem( m_From, t, true ) )
{
m_From.SendMessage( "You have been refunded "+m_VinePrice.ToString()+" gold for the deleted vine." );
return true;
}
else
{
t.Delete();
m_From.SendMessage("For some reason, the refund didn't work! Please page a GM");
return false;
}
}
示例6: OnDelete
public override void OnDelete()
{
// if the game is in progress, then return all Entry fees
if(GameInProgress)
{
GameBroadcast(100003,ChallengeName); // "{0} cancelled"
// go through the participants and return their fees and clear noto
if(Participants != null)
{
foreach(IChallengeEntry entry in Participants)
{
if(entry.Status == ChallengeStatus.Forfeit) continue;
Mobile from = entry.Participant;
// return the entry fee
if(from != null && from.BankBox != null && EntryFee > 0)
{
Item gold = new Gold(EntryFee);
if ( !from.BankBox.TryDropItem( from, gold, false ) )
{
gold.Delete();
from.AddToBackpack( new BankCheck( EntryFee ) );
XmlPoints.SendText(from, 100000, EntryFee); // "Entry fee of {0} gold has been returned to you."
} else
{
XmlPoints.SendText(from, 100001, EntryFee); // "Entry fee of {0} gold has been returned to your bank account."
}
}
entry.Status = ChallengeStatus.None;
}
// clear all noto
foreach(IChallengeEntry entry in Participants)
{
RefreshNoto(entry.Participant);
}
}
EndGame();
} else
if(!GameCompleted)
{
// this is when a game is cancelled during setup
GameBroadcast(100003,ChallengeName); // "{0} cancelled"
}
base.OnDelete();
}
示例7: OnGoldGiven
public virtual bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( CheckTeachingMatch( from ) )
{
int goldtaken = Teach( m_Teaching, from, dropped.Amount / TeachScalar, true ) * TeachScalar;
if ( goldtaken > 0 )
{
dropped.Consume( goldtaken );
return dropped == null || dropped.Deleted || dropped.Amount <= 0;
}
}
else if ( IsHumanInTown() )
{
Direction = GetDirectionTo( from );
int oldSpeechHue = this.SpeechHue;
this.SpeechHue = 0x23F;
SayTo( from, "Thou art giving me gold?" );
if ( dropped.Amount >= 400 )
SayTo( from, "'Tis a noble gift." );
else
SayTo( from, "Money is always welcome." );
from.Karma += Math.Max( dropped.Amount / 10, 100 );
this.SpeechHue = 0x3B2;
SayTo( from, 501548 ); // I thank thee.
this.SpeechHue = oldSpeechHue;
dropped.Delete();
return true;
}
return false;
}
示例8: OnGoldGiven
public override bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( from is PlayerMobile && dropped.Amount == 700 )
{
PlayerMobile pm = (PlayerMobile) from;
if ( pm.NpcGuild == NpcGuild.ThievesGuild )
{
from.AddToBackpack( new DisguiseKit() );
dropped.Delete();
return true;
}
}
return base.OnGoldGiven( from, dropped );
}
示例9: OnGoldGiven
public override bool OnGoldGiven( Mobile from, Gold dropped )
{
if ( from is PlayerMobile && dropped.Amount == JoinCost )
{
PlayerMobile pm = (PlayerMobile)from;
if ( pm.NpcGuild == this.NpcGuild )
{
SayTo( from, 501047 ); // Thou art already a member of our guild.
}
else if ( pm.NpcGuild != NpcGuild.None )
{
SayTo( from, 501046 ); // Thou must resign from thy other guild first.
}
else if ( pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.UtcNow )
{
SayTo( from, 501048 ); // You are too young to join my guild...
}
else if ( CheckCustomReqs( pm ) )
{
SayWelcomeTo( from );
pm.NpcGuild = this.NpcGuild;
pm.NpcGuildJoinTime = DateTime.UtcNow;
pm.NpcGuildGameTime = pm.GameTime;
dropped.Delete();
return true;
}
return false;
}
return base.OnGoldGiven( from, dropped );
}
示例10: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
// This probably isn't OSI accurate, but we can't just make the quests redundant.
// Double-clicking the BankCheck in your pack will now credit your account.
var box = AccountGold.Enabled ? from.Backpack : from.FindBankNoCreate();
if (box == null || !IsChildOf(box))
{
from.SendLocalizedMessage(AccountGold.Enabled ? 1080058 : 1047026);
// This must be in your backpack to use it. : That must be in your bank box to use it.
return;
}
Delete();
var deposited = 0;
var toAdd = m_Worth;
if (AccountGold.Enabled && from.Account != null && from.Account.DepositGold(toAdd))
{
deposited = toAdd;
toAdd = 0;
}
if (toAdd > 0)
{
Gold gold;
while (toAdd > 60000)
{
gold = new Gold(60000);
if (box.TryDropItem(from, gold, false))
{
toAdd -= 60000;
deposited += 60000;
}
else
{
gold.Delete();
from.AddToBackpack(new BankCheck(toAdd));
toAdd = 0;
break;
}
}
if (toAdd > 0)
{
gold = new Gold(toAdd);
if (box.TryDropItem(from, gold, false))
{
deposited += toAdd;
}
else
{
gold.Delete();
from.AddToBackpack(new BankCheck(toAdd));
}
}
}
// Gold was deposited in your account:
from.SendLocalizedMessage(1042672, true, deposited.ToString("#,0"));
var pm = from as PlayerMobile;
if (pm != null)
{
var qs = pm.Quest;
if (qs is DarkTidesQuest)
{
var obj = qs.FindObjective(typeof(CashBankCheckObjective));
if (obj != null && !obj.Completed)
{
obj.Complete();
}
}
if (qs is UzeraanTurmoilQuest)
{
var obj = qs.FindObjective(typeof(Engines.Quests.Haven.CashBankCheckObjective));
if (obj != null && !obj.Completed)
{
obj.Complete();
}
}
}
}
示例11: Refund
public void Refund()
{
Gold toGive = new Gold(Price);
if (Placer.BankBox.TryDropItem(Placer, toGive, false))
{
Delete();
Placer.SendLocalizedMessage(1060397, toGive.Amount.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
}
else
{
toGive.Delete();
Placer.SendMessage("Your bankbox is full!");
}
}
示例12: OnGoldGiven
public override bool OnGoldGiven(Mobile from, Gold dropped)
{
Direction = GetDirectionTo(from);
SayTo(from, 1153420); // Oh, thank you dearie!
dropped.Delete();
return true;
}
示例13: GoldSweep
public static void GoldSweep(Mobile m, Gold gold)
{
Item item = m.Backpack.FindItemByType(typeof(GoldLedger));
GoldLedger ledger = item as GoldLedger;
if (ledger == null)
return;
if (!ledger.GoldSweeper || !GoldLedger.GoldSweeperAvailable)
return;
if (gold != null)
{
if (ledger.Gold < 999999999)
{
double maxWeight = (WeightOverloading.GetMaxWeight(m));
if ((Mobile.BodyWeight + m.TotalWeight) < (maxWeight))
{
int golda = gold.Amount;
if ((gold.Amount + ledger.Gold) > 999999999)
golda = (999999999 - ledger.Gold);
double maxgold = golda;
if (ledger.d_WeightScale > 0)
maxgold = ((maxWeight - ((double)Mobile.BodyWeight + (double)m.TotalWeight)) / ledger.d_WeightScale);
if (golda > maxgold)
golda = (int)maxgold;
int GoldID = 0;
if (golda == 1)
GoldID = gold.ItemID;
else if (golda > 1 && golda < 6)
GoldID = gold.ItemID + 1;
else if (golda >= 6)
GoldID = gold.ItemID + 2;
if (golda < gold.Amount)
gold.Amount -= golda;
else
gold.Delete();
ledger.Gold += golda;
if (ledger.b_open && golda > 0)
{
m.CloseGump(typeof(GoldLedgerGump));
m.SendGump(new GoldLedgerGump(ledger));
}
if (golda > 0)
{
m.SendMessage(2125, "You deposit {0} gold into your gold ledger.", golda.ToString("#,0"));
if (!m.Mounted)
m.Animate(32, 5, 1, true, false, 0);
Effects.SendMovingEffect(gold, m, GoldID, 5, 50, true, false);
m.PlaySound(0x2E6);
}
}
}}}}}
示例14: getGold
private static void getGold(string charUID, Mobile pm)
{
int amount = 0; // montants d'or
int bankboxAmount = 0;
string backpack = getPlayerItemSerial(charUID, SphereFiles.backFile); // sac du joueur
string bankbox = getPlayerItemSerial(charUID, SphereFiles.bankFile); // banque du joueur
// On parcourt le fichier qui contient tous les enregistrements d'or
foreach (string line in File.ReadAllLines(SphereFiles.goldFile))
{
if (line.StartsWith("AMOUNT="))
amount = Int32.Parse(line.Split('=')[1]);
if (amount > 0 && line.StartsWith("CONT=") && line.Split('=')[1] == backpack)
{
Item gold = new Gold(amount);
Container pack = pm.Backpack;
if (pack != null)
pack.DropItem(gold);
else
gold.Delete();
amount = 0;
}
else if (amount > 0 && line.StartsWith("CONT=") && line.Split('=')[1] == bankbox)
{
bankboxAmount += amount;
amount = 0;
//Item gold = new Gold(amount);
//Container bank = pm.BankBox;
//if (bank != null)
// bank.DropItem(gold);
//else
// gold.Delete();
}
}
if (bankboxAmount > 0)
{
Container bank = pm.BankBox;
if (bank != null)
{
BankCheck check = new BankCheck(bankboxAmount);
check.Name = "Or Banque";
bank.DropItem(check);
}
}
bankboxAmount = 0;
}
示例15: CashCheck
public static void CashCheck(Mobile from, BankCheck check)
{
BankBox box = from.BankBox;
if (box != null)
{
int deposited = 0;
int toAdd = check.Worth;
check.Delete();
Gold gold;
while (toAdd > 60000)
{
gold = new Gold(60000);
if (box.TryDropItem(from, gold, false))
{
toAdd -= 60000;
deposited += 60000;
}
else
{
gold.Delete();
from.AddToBackpack(new BankCheck(toAdd));
toAdd = 0;
break;
}
}
if (toAdd > 0)
{
gold = new Gold(toAdd);
if (box.TryDropItem(from, gold, false))
{
deposited += toAdd;
}
else
{
gold.Delete();
from.AddToBackpack(new BankCheck(toAdd));
}
}
}
}