Yoko

All sides of Injection
It is currently 2024-04-26 02:50:26

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Buy/Sell на RunUO
PostPosted: 2006-05-12 00:03:38 
Offline
User avatar

Joined: 2005-07-10 21:53:05
Posts: 457
Сфере еще как-то можно понять, как этим пользоваться, то на RunUO это не так просто. В отличии от Сферы клиент передает серверу не текст, а ключ. Естественно инжа ключи передавать не умеет, по этому нужно изогнутся с тем что есть…

Code:
sub buy()
   var ID_Vendor = 0x00000000
   UO.Say(',buy regi')
   UO.Say(',vendormenu ID_Vendor 2')
endsub


Code:
sub sell()
   var ID_Vendor = 0x00000000
   repeat
      UO.Say(',sell poison')
      UO.Say(',vendormenu ID_Vendor 3')
      wait(1500)
   until not UO.Count(0x0F0A)
endsub

Конструкции не претендуют на шедевр, но работают.

Но это еще не самое ужасное, названия предметов для продажи или покупки на RunUO закодированы. Вот пример листа.

Code:
   <shoplist name="regi">
      <shopitem name="1023976" want="-1"/>
      <shopitem name="1023973" want="-1"/>
      <shopitem name="1023974" want="-1"/>
      <shopitem name="1023980" want="-1"/>
      <shopitem name="1023963" want="-1"/>
      <shopitem name="1023962" want="-1"/>
      <shopitem name="1023972" want="-1"/>
      <shopitem name="1023981" want="-1"/>
   </shoplist>

Вот как их вычисляет сервер

Code:
      public override int LabelNumber
      {
         get
         {
            MultiComponentList mcl = this.Components;

            if ( mcl.List.Length > 0 )
               return 1020000 + (mcl.List[0].m_ItemID & 0x3FFF);

            return base.LabelNumber;
         }
      }

А теперь на русском, как его вычислить простым смертным.

Берем тип предмета, например NS 0x0F88
Переводим 0F88 в десятичный вид и получаем 3976
1020000 + 3976 = <shopitem name="1023976" ……/>


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited