It is currently 28 Mar 2024, 20:53

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 19 Feb 2018, 11:27 
Offline
Начинающий игрок
User avatar

Joined: 09 Feb 2018, 15:47
Posts: 23
Приветствую.

Иногда бегаю паладином.
Добавил в хоткеях Cast on friend - Heal/GHeal;
Добавил друзей в закладке Friends;
При попытке кастовать на друга пишет - "Выберите таргет".

Как мне лучше хилить друзей, чем просто тыкать по статус барам? Или как быстро выбрать дружественный таргет?
Возможно у кого-то есть скрипт на Орион для кросс-хила, который есть на форуме для UOSteam?


Top
 Profile  
 
PostPosted: 19 Feb 2018, 12:15 
Offline
Начинающий игрок
User avatar

Joined: 09 Feb 2018, 15:47
Posts: 23
Думаю людям пригодится. Нашел на форуме Орион autoload.
На сервере еще не проверял, но думаю будет работать, или с маленькими доработками. Проверю сегодня вечером.

Функции:
CastFriend('spellname') - кастует во френда со списка указанный спелл, радиус 18 тайлов;
SwitchFriend() - функция переключения между друзьями со списка.
В скрипте присутствуют и иные функции которые я не описал.
Источник

Code:
//cast spell with a given name on player u have attacked
function CastAttackedEnemy(spellName)
{
   Orion.Cast(spellName, 'lastattack');
}

//cast spell with a given name on yourself
function CastSelf(spellName)
{
   Orion.Cast(spellName, 'self');
}

function CastNearestInjuredFriend(spellName)
{
   var friendSerialString = Orion.FindFriend('injured|live', '18');
   if(!friendSerialString.length)
   {
      Orion.Print( '-1', 'Found no friends nearby');
      return;
   }
   Orion.Cast(spellName, serial);
}

//cast spell with a given name on your chosenFriend which is a saved Serial in Lists -> Objects
//or make a new one
function CastFriend(spellName)
{
   var chosenFriend = Orion.FindObject('chosenFriend');
   if(chosenFriend == null || chosenFriend == 0)
   {
      Orion.Print( '-1', 'No chosen friend found');
      Orion.Print( '-1', 'Target a mobile to mark him as your chosen friend.');
      Orion.AddObject('chosenFriend');
      while(Orion.HaveTarget())
      {
         Orion.Wait('50');
      }
      chosenFriend = Orion.FindObject('chosenFriend');   
      //Orion.AddFriendList(chosenFriend.Serial()); need to implement
   }
   Orion.Print( '-1', 'try cast friend ' + chosenFriend.Name());
   Orion.Cast(spellName, chosenFriend.Serial());
   
}

//cast spell with a given name on target
function CastTargetedEnemy(spellName)
{
   Orion.Cast(spellName, 'lasttarget');
}

//helper function for AttacktNextHuman() and TargetNextHuman()
function FindNearestHumanEnemy()
{   
   Orion.Ignore('self');
   var friends = Orion.GetFriendList();
   for(var i = 0; i < friends.length; i++)
   {
      Orion.Ignore(friends[i]);
   }
   
   var humans = Orion.FindType('0x0190|0x0191', '-1', ground, 'near|mobile', '18');   
   if ( !humans.length )
   {
      Orion.Print( '-1', 'no humans found, resetting ignore list');
      Orion.IgnoreReset();
      return '';
   }
   return humans[0];
}

//This function will swap between players in range of 18 and attack them.
function AttacktNextHuman()
{
   var serial = FindNearestHumanEnemy();
   if(!serial.length) return;
   CharPrintDelayed(serial, '30', 'ATTACKING');
   Orion.ClientLastAttack(serial);
   Orion.Attack(serial);
   Orion.Ignore(serial);       

}

//This function will swap between players in range of 18 and target them.
function TargetNextHuman()
{
   var serial = FindNearestHumanEnemy();
   if(!serial.length) return;
   CharPrintDelayed(serial, '30', 'TARGET');
   Orion.ClientLastTarget(serial);
   Orion.TargetObject(serial);
   Orion.Ignore(serial);       
}

//This function will swap between your nearby friends from your friend list
function SwitchFriend()
{
   var friend = Orion.FindFriend('next', '18');
   if(!friend.length)
   {
      Orion.Print('-1', 'There are no friends nearby');
      return;
   }   
   Orion.AddObject('chosenFriend', friend);
}

function FindSerialRecursive(friendsAmount, friends, i)
{
   if(friendsAmount - 1 != i)
   {   
      friend =  Orion.FindObject(friends[i + 1]);
      if(friend == null)
         return FindSerialRecursive(friendsAmount, friends, i + 1 );
      else
         return friend;
   }
   else
   {
      //loop over friends again and take the first one which is neaby
      for(var c = 0; i < friendsAmount; c++)
      {
         friend = Orion.FindObject(friends[c]);
         if(friend != null)
            return friend;
      }
            
   }
}

function CharPrintDelayed(serial, color, text)
{
   var oldUse = Orion.OptionScaleSpeech();
   var oldDelay = Orion.OptionScaleSpeechDelay();
 
   Orion.OptionScaleSpeech(true);
   Orion.OptionScaleSpeechDelay(50);
 
   Orion.CharPrint(serial, color, text);
   Orion.Wait(50);
 
   Orion.OptionScaleSpeech(oldUse);
   Orion.OptionScaleSpeechDelay(oldDelay);
}


Top
 Profile  
 
PostPosted: 19 Feb 2018, 21:50 
Offline
Ветеран
User avatar

Joined: 04 Mar 2015, 16:47
Posts: 676
Code:
function ResNearestDeadFriend()
{
    var friend = Orion.FindFriend('dead', 18);
    if(friend.length)
        Orion.Cast('Resurrection', friend);
    else
        Orion.Print('-1', 'Found no injured friends neaby to resurrect');   
}
function HealNearestInjuredFriend()
{
    var friend = Orion.FindFriend('injured', 18);
    if(friend.length)
        Orion.Cast('Greater Heal', friend);
    else
        Orion.Print('-1', 'Found no injured friends neaby to heal');   
}

_________________
English Discord Chat || Русский Дискорд чат

Уо без понтов - безпонтовое уо.


Top
 Profile  
 
PostPosted: 20 Feb 2018, 20:39 
Offline
Начинающий игрок
User avatar

Joined: 09 Feb 2018, 15:47
Posts: 23
Slacker wrote:
Code:
function ResNearestDeadFriend()
{
    var friend = Orion.FindFriend('dead', 18);
    if(friend.length)
        Orion.Cast('Resurrection', friend);
    else
        Orion.Print('-1', 'Found no injured friends neaby to resurrect');   
}
function HealNearestInjuredFriend()
{
    var friend = Orion.FindFriend('injured', 18);
    if(friend.length)
        Orion.Cast('Greater Heal', friend);
    else
        Orion.Print('-1', 'Found no injured friends neaby to heal');   
}

Спасибо!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 163 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 Group