Page 1 of 1
mounted and skills discussion
Posted: Wed Dec 28, 2011 7:50 pm
by lisa
This discussion was started in another thread which had nothing to do with skills and being mounted, so moving discussion to here.
Last post of note is by rock
rock5 wrote:This was doing my head in. Took me ages to figure out I forgot to change the WPL_TRAVEL to WPT_TRAVEL. LoL
But now it seems to be working fine with type="TRAVEL" at the top of the file. Unfortunately
Code: Select all
__WPL:setForcedWaypointType("TRAVEL")
doesn't seem to work. The waypoint type doesn't seem to change. Even
doesn't work. It seems to change the type but still tries to attack.
I think I'm not understanding the type stuff properly. I've had enough for tonight. Maybe I'll look into it some more tomorrow.
Re: mounted and skills discussion
Posted: Wed Dec 28, 2011 7:55 pm
by lisa
lisa wrote:
kanta wrote:The problem is that this code works a little too well... Even if in NORMAL travel mode, it won't cast skills if mounted. So if in NORMAL mode while mounted and you get attacked, the bot will stop moving and not fight back. At least that's how it acted for me.
Hmm I didn't anticipate the bot just stopping, that is deffinately not what we want to happen.
I'll have to blow the cobwebs off some chars and do some testing.
I'll see if I can do some testing on this later today, pretty busy at the moment so not sure if I will have time or not.
I was having a thought earlier, is there any time when you are mounted that you do actually want to use skills?
Generally if mounted you are trying to get somewhere faster, you wouldn't normally mount to go from mob to mob.
So if you know you are traveling from place to place then you will probably also know where you want to dismount aswell and not before hand?
That is the way I see it anyway, any other thoughts?
Re: mounted and skills discussion
Posted: Wed Dec 28, 2011 10:59 pm
by rock5
So I figured it out in my head last night. __WPL.Type doessn't change. _WPL.ForcedType changes when the "setForcedWaypointType" command is used. Each waypoint can also have it's own "Type" setting as well. So the way it works is, moveTo gets the next waypoint using wpl:getNextWaypoint. getNextWaypoint creates a temporary waypoint with the coordinates of the next waypoint and then looks at __WPL.Type and _WPL.ForcedType and if the waypoint has it's own Type, then sets the temporary waypoint to the "correct type". So this "correct type" only exists in the moveTo function where it called the getNextWaypoint function.
I think now with this better understanding I can get it to work from in the moveTo function. I'll try it now.
lisa wrote:I was having a thought earlier, is there any time when you are mounted that you do actually want to use skills?
Generally if mounted you are trying to get somewhere faster, you wouldn't normally mount to go from mob to mob.
So if you know you are traveling from place to place then you will probably also know where you want to dismount aswell and not before hand?
That is the way I see it anyway, any other thoughts?
You don't know what someone want to do at the other end. They might want to travel to their next hunting ground and want to start fighting as soon as they get there. I think it's a bit much to expect users to remember to dismount. It should attack if the bot decides to atack. Which brings me to another point. The bot already does a good job of deciding if to attack or not. The problem is the buffs. So if the bot has decided to attack a mob, for whatever reason, then yours and my settings shouldn't interfere with it. We should just be trying to stop it casting buffs.
Re: mounted and skills discussion
Posted: Wed Dec 28, 2011 11:29 pm
by lisa
rock5 wrote:We should just be trying to stop it casting buffs.
That would be a very good idea and probably potions aswell.
checkSkills()
actually has a checkpotions at the end of it.
I might do some testing of this
Code: Select all
local useQueue = true;
if( #self.SkillQueue > 0 ) then
-- Queue is not empty. See if we can cast anything
local skill = self:getNextQueuedSkill();
if settings.profile.options.DISMOUNT == false and player.Mounted and skill.Type == "buff" then return false end
local target = self:getTarget();
if( skill.Blocking ) then
So instead of stopping the code before even checking for skill que, let it get to skill que and then check if the skill is a buff.
Could actually get rid of the profile option altogether if doing it this way. It should only stop bot casting buffs.
might need to be
Maybe stop heals aswell? if we only want bot to dismount if attacking ?
Re: mounted and skills discussion
Posted: Wed Dec 28, 2011 11:37 pm
by lisa
Hmm Something like this might be better
Code: Select all
local skill = self:getNextQueuedSkill();
if player.Mounted and (skill.Type ~= 0 and skill.Type ~= 3 ) then return false end
keeping in mind
-- Skill types
STYPE_DAMAGE = 0
STYPE_HEAL = 1
STYPE_BUFF = 2
STYPE_DOT = 3
STYPE_HOT = 4
STYPE_SUMMON = 5
So will only use damage or damage over time skills if mounted.
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 12:50 am
by kanta
lisa wrote:So if you know you are traveling from place to place then you will probably also know where you want to dismount aswell and not before hand?
Pretty much what I ended up doing is switching the true and false values for the dismount option within my waypoint file. 99% of the time it works just fine for me as it is, there was only one file that I had difficulty with.
As for it being talked about in my thread, no worries. It happens.

Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 1:53 am
by rock5
lisa wrote:if settings.profile.options.DISMOUNT == false and player.Mounted and skill.Type == "buff" then return false end
I think that is the solution. Just stop all buffs (and heals) while mounted. If it attacks a mob then it will dismount and use skills as normal. Of course if it attacks a mob when mounted, it wont use any heals or buffs until it dismounts. It would be good that if it new it was going to attack then use heals and buffs. Maybe we could use player.Fighting. That's supposed to indicate that you are starting to fight.
lisa wrote:
Code: Select all
local skill = self:getNextQueuedSkill();
if player.Mounted and (skill.Type ~= 0 and skill.Type ~= 3 ) then return false end
keeping in mind
-- Skill types
STYPE_DAMAGE = 0
STYPE_HEAL = 1
STYPE_BUFF = 2
STYPE_DOT = 3
STYPE_HOT = 4
STYPE_SUMMON = 5
I'd just use the variables, that's what they're there for.
Code: Select all
if player.Mounted and (skill.Type ~= STYPE_DAMAGE and skill.Type ~= STYPE_DOT ) then return
How about summoning? Do we want it to summon when mounted?
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 2:02 am
by lisa
rock5 wrote:How about summoning? Do we want it to summon when mounted?
I am going to go with no to summoning while mounted.
Eventually I intend to use the wardenpet class I am working on which will deal with summoning and such, long way off yet though.
Does the bot try to summon pets in a normal skill rotation though, if it does then I doubt we want that happening as you are just riding along on your horse, probably better to deal with that in the player:fight() code.
Might need to also check if it tries to use type summon while travel or run ?
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 3:40 am
by rock5
I've got it!
I had another look at this line in player:moveTo, line 2161.
Code: Select all
if ( self:checkPotions() or self:checkSkills(ONLY_FRIENDLY) ) then -- only cast friendly spells to ourselfe
This is the only time it checks for potions and skills in moveTo. These are
only heals and buff so, seeing as we've established we only want to stop heals and buffs, all we have to do is bypass these if mounted. So
Code: Select all
if not player.Mounted and ( self:checkPotions() or self:checkSkills(ONLY_FRIENDLY) ) then -- only cast friendly spells to ourselfe
works. Except it also checks potions and friendly skills between moveTos in bot.lua. So around line 745 of bot.lua also change
Code: Select all
player:checkPotions();
player:checkSkills( ONLY_FRIENDLY ); -- only cast hot spells to ourselfe
to
Code: Select all
if not player.Mounted then
player:checkPotions();
player:checkSkills( ONLY_FRIENDLY ); -- only cast hot spells to ourselfe
end
For me this works perfectly. When type = travel it never dismounts even when loosing buffs. When type = run it only dismounts if attacked and even casts buffs and heals first if they have higher priority. And of course when type = normal it dismounts immediately when attacking a mob.
Try it out.
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 4:21 am
by lisa
Cool sounds good, I'll take your word that it works, I don't really get to test out to much stuff in game now days.
The code deffinately should work though so I would say you are right.
How about the travel changing option did you work out if that does what we think it should or is it still not working properly?
If we get changing waypoint type working then won't need the profile option for dismount anymore.
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 4:51 am
by rock5
lisa wrote:How about the travel changing option did you work out if that does what we think it should or is it still not working properly?
Do you mean "setForcedWaypointType"? That's what I was testing with. Worked perfectly. The problem I reported is just because I didn't understand it properly yet.
lisa wrote:If we get changing waypoint type working then won't need the profile option for dismount anymore.
Probably true. If someone wants it to not dismount then all they have to do is set type to travel and mount up.
Re: mounted and skills discussion
Posted: Thu Dec 29, 2011 3:47 pm
by kanta
The new code is working great for me.