Page 1 of 1

Problem with LOS (Line of sight) when mounted

Posted: Thu Dec 08, 2011 9:44 am
by Shogun
It happens quite often that the bot is not able to attack or fight back when mounted. Previously the character automatically was unmounted, with LOS it gets a lot of hits until the mount occasionally does not block the line. The bot now better should unmount at the begin of the attack.

Re: Problem with LOS (Line of sight) when mounted

Posted: Thu Dec 08, 2011 12:45 pm
by rock5
I haven't noticed that happening and I have been starting attacks mounted.

Does it happen with all mobs or certain mobs? Does it happen with all mounts or only certain mounts.

Re: Problem with LOS (Line of sight) when mounted

Posted: Thu Dec 08, 2011 2:20 pm
by Shogun
I noticed this several times at the butterflies. The mob is in front of the mount, attacks and the character moves backwards with every hit. There is repetitive this message "line of sight blocked". I usually ended this by unmounting manually. There may be a difference by the kind of mount, I only have pegasus.

Re: Problem with LOS (Line of sight) when mounted

Posted: Thu Dec 08, 2011 2:26 pm
by rock5
Can you get your hands on a temp mount?

Re: Problem with LOS (Line of sight) when mounted

Posted: Fri Dec 09, 2011 2:49 am
by Shogun
Changing the mounts is no option, I have mounts that can walk on water. I will now solve this with a call to CancelBuff() when entering the butterfly area. The described behaviour looks too bottish and low level chars do not survive.

Re: Problem with LOS (Line of sight) when mounted

Posted: Fri Dec 09, 2011 3:18 am
by rock5
Shogun wrote:Changing the mounts is no option, I have mounts that can walk on water. I will now solve this with a call to CancelBuff() when entering the butterfly area. The described behaviour looks too bottish and low level chars do not survive.
I didn't mean permanently, I meant just to test if the problem is your mount. I actually tested a pegasus I had with one of my characters. Still had no issues but it was the older type that doesn't walk on water.

Anyway, cancelling the horse is easy enough.

Re: Problem with LOS (Line of sight) when mounted

Posted: Mon Jan 16, 2012 12:35 pm
by Shogun
rock5 wrote:I've added

Code: Select all

player:dismount()
to revision 690. Enjoy.
Nice to have that now, thanks rock!

To solve the described problem you can add a dismount call in CPlayer:fight()

Code: Select all

	-- Prep for battle, if needed.
	--self:checkSkills();

	self:dismount();

--	local target = self:getTarget();  / double
I added an unmount function about 4 weeks ago, did not make it public because you have to add your mounts to a mounts table. If anyone is interested, but i recommend to use rock's function:

Code: Select all

function CPlayer:unmount()
	if( not self.Mounted ) then return; end

	local mounts_table = {
		{ MountName="Flying Rune Disk (Permanent)", ID=206946, BuffID = 506176},
		{ MountName="Pegasus Mount (Permanent, Swim)", ID=206283, BuffID = 505066},
		{ MountName="Black Pegasus Mount (Permanent, Swim)", ID=206289, BuffID = 505065},
		{ MountName="Purple Crested Ostrich Mount (Permanent)", ID=206316, BuffID = 505075},
		};
	for i, v in pairs(mounts_table) do
		if player:hasBuff(v.BuffID) then
			RoMScript("igf_CancelBuff("..v.BuffID..");")
			-- yrest(300);
			repeat
				yrest(100);
				self:update();
			until self.Mounted == false
			return;
		end
	end
end
What still can be usefull is the CancelBuff ingame function:

Code: Select all

function igf_CancelBuff(buffNameOrId)
  local i=0;
  repeat
    i=i+1
    local buff,icon,cnt,id,params = UnitBuff("player", i);
      -- ChatFrame1:AddMessage("buff:"..buff.." id:"..id);
      if type(buffNameOrId) == "number" then
        if( id == buffNameOrId ) then
          ChatFrame1:AddMessage("igf_CancelBuff("..buff..")");
          CancelPlayerBuff(i);
          return;
        end
      else
        if( buff == buffNameOrId ) then
          ChatFrame1:AddMessage("igf_CancelBuff("..buff..")");
          CancelPlayerBuff(i);
          return;
        end
      end
  until (buff==nil);
end

Re: Problem with LOS (Line of sight) when mounted

Posted: Mon Jan 16, 2012 9:40 pm
by rock5
What I did was just make it mount again to dismount. That way it uses the same list of mounts and doesn't require a whole new function. All I did was modify mount to accept an argument to dismount

Code: Select all

player:mount(true)
This will dismount instead of mount. Then I added a simple dismount function to call that.

Code: Select all

function CPlayer:dismount()
	self:mount(true)
end
Much simpler and easier to maintain.