public override void OnDoubleClick(Mobile from) { if (this.IsChildOf(from.Backpack)) { if (!(this.Deleted)) { if (TokenSystem.GiveTokensToPlayer(from as PlayerMobile, i_TokensAmount)) { from.SendMessage(1173, "You added {0} Tokens to your account using a token check.", i_TokensAmount); this.Delete(); } else { from.SendMessage(1173, "You were unable to add tokens to your account."); } } else { from.PlaySound(1069); //play Hey!! sound from.SendMessage(1173, "Hey, don't try to rob the bank!!!"); } } else { from.SendMessage(1173, "The check must be in your backpack to be used."); } }
public static void EmptyTrash(Mobile from, Trash4TokensBackpack backpack) { if (backpack == null) { return; } backpack.cleaningBag = true; List <Item> items = backpack.Items; int i_Reward = 0; if (items.Count > 0) { from.PlaySound(0x76); for (int i = items.Count - 1; i >= 0; --i) { if (i >= items.Count) { continue; } Item it = (Item)items[i] as Item; if (it.Stackable == false && !((Item)items[i] is BaseBook)) { i_Reward += Utility.RandomMinMax(2, 5); } ((Item)items[i]).Delete(); } } if (i_Reward > 0 && TokenSystem.GiveTokensToPlayer(from as Server.Mobiles.PlayerMobile, i_Reward)) { from.SendMessage(1173, "You were rewarded {0} Tokens to your account for cleaning the shard.", i_Reward); } backpack.cleaningBag = false; }
public static void RewardTokens(Mobile m, int amount) { if (amount < 1) { return; } //MasterStorageUtils.GiveTypeToPlayer(m as PlayerMobile, typeof(Daat99Tokens), amount, true); TokenSystem.GiveTokensToPlayer(m as PlayerMobile, amount, true); }
public override void OnDoubleClick(Mobile from) { if (this.IsChildOf(from.Backpack) && !this.Deleted) { if (TokenSystem.GiveTokensToPlayer(from as PlayerMobile, Amount)) { from.SendMessage(1173, "You added {0} tokens to your account.", Amount); this.Delete(); } else { from.PlaySound(1069); //play Hey!! sound from.SendMessage(1173, "Please make sure your Master Storage is inside your backpack with an active Tokens account."); } } else { from.PlaySound(1069); //play Hey!! sound from.SendMessage(1173, "Hey, don't try to rob the bank!!!"); } }