https://github.com/caleb-dp/Phoenix
Zacnu s malem, treba se nekomu budou hodit.
Bishop hat
Umisteni: samostatny soubor napr. BishopHat.cs
Exec: ,exec SwitchBishopHat
Co to dela:
1) Mate Bishop hat
- pokud nemate nasazenou Bisopku, ulozi si jeji kontainer, X a Y a aktualni nasazenou helmu. Nasadi a vypise nad hrace "<Bishop nasazen + aktualni HP">.
- pokud mate nasazenou Bishopku
a] mate >= 50HP - schodi Bisopku a vrati ji do kontaineru kde byla u na pozici X a Y kde byla. Nasadi z5 predchozi helmu. Vypise nad hrace "<Bishop sundan>".
b] mate < 50HP + vypise nad hrace "Mas malo HP!"
2) Nemate Bishop hat
- Vypise do konzole "Nemas bishop hat!".
Kód: Vybrat vše
using Phoenix.WorldData;
using Phoenix;
namespace CalExtension.UOExtensions
{
  [RuntimeObject]
  public class BishopHat
  {
    //------------------------------------------------------------------------------------------
    public static readonly Graphic BishopGraphic = 0x1DB9;
    public static readonly UOColor BishopColor = 0x0BB0;
    //------------------------------------------------------------------------------------------
    private UOItem lastHeadArmor;
    private ushort? lastHatX;
    private ushort? lastHatY;
    private Serial lastHatContainer;
    //------------------------------------------------------------------------------------------
    [Executable]
    public void SwitchBishopHat()
    {
      if (World.Player.Layers[Layer.Hat].Graphic == BishopGraphic && World.Player.Layers[Layer.Hat].Color == BishopColor)
      {
        if (World.Player.Hits >= 50)
        {
          if (lastHatX.HasValue && lastHatY.HasValue && lastHatContainer != null && lastHatContainer != Serial.Invalid)
          {
            World.Player.Layers[Layer.Hat].Move(1, lastHatContainer, lastHatX.Value, lastHatY.Value);
          }
          else
            World.Player.Layers[Layer.Hat].Move(1, World.Player.Backpack);
          UO.Wait(400 + Core.CurrentLatency);
          if (lastHeadArmor != null && lastHeadArmor.Exist)
            lastHeadArmor.Use();
          World.Player.Print(0x005d, "<Bishop sundan>");
        }
        else
          World.Player.Print(0x0025, "Mas malo HP!");
      }
      else if (World.Player.Backpack.AllItems.FindType(BishopGraphic, BishopColor).Exist)
      {
        UOItem bishop = World.Player.Backpack.AllItems.FindType(BishopGraphic, BishopColor);
        lastHeadArmor = World.Player.Layers[Layer.Hat];
        lastHatContainer = bishop.Container;
        lastHatX = bishop.X;
        lastHatY = bishop.Y;
        bishop.Use();
        UO.Wait(100 + Core.CurrentLatency);
        World.Player.Print(0x0044, "<Bishop nasazen " + World.Player.Hits + ">");
      }
      else
      {
        UO.Print(0x0025, "Nemas Bishop hat!");
      }
    }
    //------------------------------------------------------------------------------------------
  }
}









 Za mě velké ale bezvýznamné plus
  Za mě velké ale bezvýznamné plus  





