Page 1 of 1

Buff char in range

Posted: Thu Oct 17, 2013 3:05 am
by gloover
Hey experts.

I'm using this script to buff especially selected chars in range (doing with priest/mage)

Code: Select all

playerNames = {"Name1","Name2","Name331"}

while (true) do

    for k, v in ipairs(playerNames) do
		local char = player:findNearestNameOrId(v)
        if char and 150 > distance(char.X, char.Z, player.X, player.Z) then
			player:target(char)
			player:checkSkills(true);
		
		end
    end
end
the problem I've is that using "player:checkSkills(true)" all character only gets "PRIEST_AMPLIFIED_ATTACK" and "PRIEST_GRACE_OF_LIFE" but not "Fire Ward" and "Magic Barrier" (both are defined in the profile) even if they're in party.

How can I check for targets (group) buff (fire ward, Magic barrier)?

thx in advance!

Re: Buff char in range

Posted: Thu Oct 17, 2013 3:50 am
by rock5
It was probably decided they they were more appropriately for personal use so they were given the 'target' value of "self". The bot sees that as meaning they can only be used on yourself. Try changing 'target' to "friendly" for those skills. You will have to set the ranges as well.

Re: Buff char in range

Posted: Thu Oct 17, 2013 3:59 am
by Bill D Cat
Fire Ward and Magic Barrier are both PARTY buffs, and so you can't target players outside of your party to use these two buffs.

Re: Buff char in range

Posted: Thu Oct 17, 2013 5:49 am
by gloover
@ Bill - take a look at rocks post above, so I can prove you wrong!

@ rock - thank u very much for your suggestion, changing the option in onload to

Code: Select all

changeProfileSkill("MAGE_FIRE_WARD", "Target", 2);	
solve the problem!

Re: Buff char in range

Posted: Thu Oct 17, 2013 6:01 am
by Bill D Cat
Mage's Fire Ward: Increase the party's Fire resistance by 10.0 points for 10 minutes.

Priest's Magic Barrier: For 900.0 seconds, all party members' Magical Defense increases by 6.0%. (The maximum level of this skill is 50.)
Now what part of "they are PARTY buffs" are you proving me wrong on? Unless these skills have been changed to single target buffs, my statement remains the same. What you are probably seeing is that you can now cast it on the whole party when you detect that one member doesn't have the buff. I don't believe you can just randomly buff a player that is not in your party with either of those skills.

Re: Buff char in range

Posted: Thu Oct 17, 2013 6:43 am
by gloover
Bill, You've got me wrong. You've right, both skills works only in party - so the requirement to get this buffs is to be in party, BUT my intention was not to check every party member i.e

Code: Select all

for i,v in ipairs(partymemberpawn) do 
... 
I only wants to check for one especially character (or using a party check: party member) in range and renew his buffs. I also have changed my code to make a check, if this special character is in party or not.

Anyway, thx for your answer.