Public feed
#379797
objectdef oMount inherits oBase
{
method Mount()
{
;Dont try to mount if already mounted
if ${This.IsMounted}
{
return
}
; If we dont have a mount dont try to mount
if !${This.GetMount(exists)}
{
return
}
;If it is a spell cast it otherwise use it
if ${Spell[${This.GetMount}](exists)}
{
cast ${This.GetMount}
}
else
{
Item[${This.GetMount}]:Use
}
}
member GetMount()
{
variable string themount = "NONE"
variable guidlist ItemList
;Epic
if ${Spell[Summon Dreadsteed](exists)}
{
return ${Spell[Summon Dreadsteed].ID}
}
if ${Spell[Summon Charger](exists)}
{
return ${Spell[Summon Charger].ID}
}
ItemList:Search[-items,-inventory,-usable,-epic,-skill, Riding]
if ${ItemList.Count} > 0
{
return ${Item[${ItemList.GUID[1]}]}
}
;None Epic
if ${Spell[Summon Felsteed](exists)}
{
return ${Spell[Summon Felsteed].ID}
}
if ${Spell[Summon Warhorse](exists)}
{
return ${Spell[Summon Warhorse].ID}
}
ItemList:Search[-items,-inventory,-usable,-skill, Riding]
if ${ItemList.Count} > 0
{
return ${Item[${ItemList.GUID[1]}]}
}
return
}
method Dismount()
{
WoWScript Dismount()
}
member IsMounted()
{
if ${WoWScript[IsMounted()]}
{
return TRUE
}
return FALSE
}
}
function main()
{
variable guidlist LootList
variable int Index = 1
variable oMount MyMount
echo "Testing"
echo Can Mount ${MyMount.GetMount}
MyMount:Mount
}