Hráčští vendoři
Napsal: 29 srp 2016 17:51
Postupně otevře nákupní menu od všech vendorů v dosahu prodeje (2 políčka) s dostatečnou pauzou.
,vendor_hrac
,vendor_hrac
Kód: Vybrat vše
using System;
using System.Collections.Generic;
using Phoenix;
using Phoenix.WorldData;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Phoenix.Gui;
namespace Scripts.DarkParadise
{
public class doplnky
{
[Command]
public static void npc()
{
UOCharacter ch = true ? findvendor() : new UOCharacter(UIManager.TargetObject());
if (!ch.Exist)
ScriptErrorException.Throw("NPC neni v dosahu.");
UO.Say(0x0504, ch.Name + " hi");
}
[Command]
public static void vendor()
{
UOCharacter ch = true ? findvendor() : new UOCharacter(UIManager.TargetObject());
if (!ch.Exist)
ScriptErrorException.Throw("Vendor neni v dosahu.");
UO.Say(ch.Name + " buy");
}
[Command]
public static void vendor_hrac()
{
UOCharacter output = new UOCharacter(Serial.Invalid);
foreach (UOCharacter ch in World.Characters)
if ((ch.Model == 0x0191 || ch.Model == 0x0190) & (ch.Name != World.Player.Name))
if (ch.Distance < 3 && ch.Distance < output.Distance) {
UO.Say(ch.Name + " buy");
UO.Wait(500);
}
}
private static UOCharacter findvendor()
{
UOCharacter output = new UOCharacter(Serial.Invalid);
foreach (UOCharacter ch in World.Characters)
if ((ch.Model == 0x0191 || ch.Model == 0x0190) & (ch.Name != World.Player.Name))
if (ch.Distance < 5 && ch.Distance < output.Distance)
output = ch;
return output;
}
}
}