View Single Post
  #9  
Unread 09-02-2012, 12:45 AM
MrJackdaw's Avatar
MrJackdaw MrJackdaw is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Feb 2009
Location: Lancaster, England
Posts: 249
Excellent!

Like you say, I am sure there will be a Mount:IsCombatMount() function or soemthing similar, but if this works we have a workaround!

EDIT:

Tried this, seems "Nicer";

Code:
import "Turbine.Gameplay"

player	= Turbine.Gameplay.LocalPlayer.GetInstance()


function player:IsCombatMount()
	local Mount	= self:GetMount()
	if Mount~=nil then
		return (Mount.GetTurnRate~=nil)
	end
end

function player:IsMounted()
	local Mount	= self:GetMount()
	return Mount~=nil 
end

player.MountChanged=function(sender,args)	

	if player:IsMounted() then
			local Mount	= player:GetMount()
			Turbine.Shell.WriteLine(Mount:GetName())
		if player:IsCombatMount() then
			Turbine.Shell.WriteLine("Combat Mount")
		else
			Turbine.Shell.WriteLine("Non Combat Mount")
		end
	else
			Turbine.Shell.WriteLine("No Mount")
	end

end
__________________
************************************************** ************************************************** **
"Our ideals may never be realised, But they indicate what we are trying to do." Dick Tahta

Last edited by MrJackdaw : 09-02-2012 at 01:00 AM.
Reply With Quote