• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

l need a little help

G

Guest

Guest
l have a problem my animal lore isnt working or l do something wrong. exp. l use lore and only shows enpty squre no info in it and btw l use UO:KR client
my vet is 0.00 if that is problem 0.00 is beacouse l cant use bandages on my rune beetle it says" you cannot perforem benefical acts on your target pls help!
maybe a noobis question but still thy for help.
 
I

imported_Sarphus

Guest
are you running a custom mod? it sounds to me like you have a custom mod running and that mod has a broken animal lore gump.

If you set it to use the default UI, your lore window should work
 
G

Guest

Guest
l dont have any custum UI or any kind of moding still not working

l cant smell if there is a good tame or not but l wish l had.
 
I

imported_Sarphus

Guest
I need to find a better place to post mods than the site I posted the original beta of my animal lore gump. The version I posted is riddled with bugs and will actually only work on older KR installs. I think the version I'm currently running will work on newer installs, but I'm not certain. It may also have a memory leak, but it's still worth using because it saves so many mouse clicks in creature evaluation.

Maybe this will help. I"ll just copy/paste the source here and maybe it will work for you


***** XML FILE ****
<Interface xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Interface.xsd">
<Scripts>
<Script file="Source/Generic/AnimalLore.lua" />
</Scripts>
<Windows>
<!-- Templates for dynamically added items -->
<HorizontalResizeImage name="HRDef" inherits="UO_Default_Horizontal_Rule">
<Size>
<AbsPoint x="460" y="4"/>
</Size>
</HorizontalResizeImage>

<!-- This is the template you use to display attributes -->
<Window name="AttributeDisplayTemplate" >
<Size>
<AbsPoint x="400" y="24"/>
</Size>
<Windows>
<DynamicImage name="$parentSquareIcon" texturescale="1" handleinput="true">
<Size>
<AbsPoint x="27" y="27" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left">
<AbsPoint x="6" y="0" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentAttributeName" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="left" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="100" y="20"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parentSquareIcon">
<AbsPoint x="30" y="0"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentAttributeValue" font="UO_DefaultText" maxchars="64" textalign="left" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="120" y="20"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="135" y="0"/>
</Anchor>
</Anchors>
</Label>
</Windows>
</Window>

<!-- Use this template to display a label + a value -->
<Window name="LabeledDataTemplate" >
<Size>
<AbsPoint x="400" y="24"/>
</Size>
<Windows>
<Label name="$parentLabel" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="left" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="150" y="20"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parentSquareIcon">
<AbsPoint x="0" y="0"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentValue" font="UO_DefaultText" maxchars="64" textalign="left" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="500" y="20"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="150" y="0"/>
</Anchor>
</Anchors>
</Label>
</Windows>
</Window>

<!-- Use this to put captions on sections of a gump -->
<Label name="TableCaptionTemplate" inherits="UO_Default_Label_Color" font="UO_Title" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="470" y="30"/>
</Size>
</Label>

<!-- Template that creates a horizontal layout resist display -->
<Window name="ResistGridTemplate">
<Size>
<AbsPoint x="470" y="60"/>
</Size>
<Windows>
<Label name="$parentTableCaption" inherits="UO_Default_Label_Color" font="UO_GoldButtonText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="400" y="30"/>
</Size>
<Anchors>
<Anchor point="topmiddle" relativePoint="topmiddle" relativeTo="$parent">
<AbsPoint x="0" y="-9"/>
</Anchor>
</Anchors>
</Label>
<HorizontalResizeImage name="$parentHRTop" inherits="UO_Default_Horizontal_Rule" layer="secondary">
<Size>
<AbsPoint x="400" y="4"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="-15"/>
</Anchor>
</Anchors>
</HorizontalResizeImage>
<VerticalResizeImage name="$parentVRLeft" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="-3" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<VerticalResizeImage name="$parentVRBlock1" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="80" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<VerticalResizeImage name="$parentVRBlock2" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="160" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<VerticalResizeImage name="$parentVRBlock2" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="240" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<VerticalResizeImage name="$parentVRBlock3" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="320" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<VerticalResizeImage name="$parentVRRightBorder" inherits="UO_Default_Vertical_Rule" layer="secondary">
<Size>
<AbsPoint x="4" y="60"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="399" y="15"/>
</Anchor>
</Anchors>
</VerticalResizeImage>
<HorizontalResizeImage name="$parentHRMiddle" inherits="UO_Default_Horizontal_Rule" layer="secondary">
<Size>
<AbsPoint x="400" y="4"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="15"/>
</Anchor>
</Anchors>
</HorizontalResizeImage>
<HorizontalResizeImage name="$parentHRBottom" inherits="UO_Default_Horizontal_Rule" layer="secondary">
<Size>
<AbsPoint x="400" y="4"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="45"/>
</Anchor>
</Anchors>
</HorizontalResizeImage>
<DynamicImage name="$parentPhysHilight" texturescale="1" handleinput="false" layer="background">
<Size>
<AbsPoint x="83" y="60" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="15" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentPhysHeader" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="0"/>
</Anchor>
</Anchors>
</Label>
<DynamicImage name="$parentFireHilight" texturescale="1" handleinput="false" layer="background">
<Size>
<AbsPoint x="80" y="60" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="82" y="15" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentFireHeader" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="80" y="0"/>
</Anchor>
</Anchors>
</Label>
<DynamicImage name="$parentColdHilight" texturescale="1" handleinput="false" layer="background">
<Size>
<AbsPoint x="82" y="60" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="162" y="15" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentColdHeader" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="160" y="0"/>
</Anchor>
</Anchors>
</Label>
<DynamicImage name="$parentPoisonHilight" texturescale="1" handleinput="false" layer="background">
<Size>
<AbsPoint x="80" y="60" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left">
<AbsPoint x="242" y="15" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentPoisonHeader" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="240" y="0"/>
</Anchor>
</Anchors>
</Label>
<DynamicImage name="$parentEnergyHilight" texturescale="1" handleinput="false" layer="background">
<Size>
<AbsPoint x="80" y="60" />
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="321" y="15" />
</Anchor>
</Anchors>
</DynamicImage>
<Label name="$parentEnergyHeader" inherits="UO_Default_Label_Color" font="UO_DefaultText" maxchars="128" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="320" y="0"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentPhysValue" font="UO_DefaultText" maxchars="64" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="0" y="30"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentFireValue" font="UO_DefaultText" maxchars="64" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="80" y="30"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentColdValue" font="UO_DefaultText" maxchars="64" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="160" y="30"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentPoisonValue" font="UO_DefaultText" maxchars="64" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="240" y="30"/>
</Anchor>
</Anchors>
</Label>
<Label name="$parentEnergyValue" font="UO_DefaultText" maxchars="64" textalign="center" autoresize="true" handleinput="false" >
<Size>
<AbsPoint x="80" y="30"/>
</Size>
<Anchors>
<Anchor point="left" relativePoint="left" relativeTo="$parent">
<AbsPoint x="320" y="30"/>
</Anchor>
</Anchors>
</Label>
</Windows>
</Window>
<!-- End of Templates for dynamically added items -->

<!-- MAIN WINDOW DEFINITION -->
<Window name="AnimalLore" movable="true" layer="default">
<Size>
<AbsPoint x="470" y="450"/>
</Size>
<!--
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="1250" y="16"/>
</Anchor>
</Anchors>-->
<EventHandlers>
<EventHandler event="OnInitialize" function="AnimalLore.Initialize"/>
<EventHandler event="OnRButtonUp" function="AnimalLore.Shutdown" />
<EventHandler event="OnShutdown" function="AnimalLore.Shutdown"/>
</EventHandlers>
<Windows>
<Window name="$parentChrome" inherits="UO_DefaultWindow">
<Anchors>
<Anchor point="topleft" relativePoint="topleft"/>
<Anchor point="bottomright" relativePoint="bottomright"/>
</Anchors>
</Window>
<!-- Navigation Tabs -->
<Button name="$parentMainTabButton" inherits="SkillsWindowTabButton" layer="secondary" >
<Size>
<AbsPoint x="100" y="23" />
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft">
<AbsPoint x="16" y="50"/>
</Anchor>
</Anchors>
<EventHandlers>
<EventHandler event="OnLButtonUp" function="AnimalLore.OpenMainTab" />
</EventHandlers>
</Button>
<Button name="$parentOtherTabButton" inherits="SkillsWindowTabButton" layer="secondary" >
<Size>
<AbsPoint x="100" y="23" />
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft">
<AbsPoint x="116" y="50"/>
</Anchor>
</Anchors>
<EventHandlers>
<EventHandler event="OnLButtonUp" function="AnimalLore.OpenOtherTab" />
</EventHandlers>
</Button>

<!-- General Window Settings -->
<FullResizeImage name="$parentBackground" inherits="HUDBackgroundBlack">
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo=""/>
<Anchor point="bottomright" relativePoint="bottomright" relativeTo=""/>
</Anchors>
</FullResizeImage>
<!-- Title Bar -->
<Window name="$parentTitleBar" inherits="UO_Default_Title_Bar">
<EventHandlers>
<EventHandler event="OnRButtonUp" function="AnimalLore.Shutdown" />
</EventHandlers>
</Window>
<Button name="$parentClose" inherits="DefaultWindowCloseButton">
<EventHandlers>
<EventHandler event="OnLButtonUp" function="AnimalLore.Shutdown"/>
</EventHandlers>
</Button>
<!-- Bottom Window Bar -->
<HorizontalResizeImage name="$parentBottomFrame" inherits="DefaultWindowResizeBottomFrame">
<Anchors>
<Anchor point="bottomleft" relativePoint="bottomleft" relativeTo="$parent">
<AbsPoint x="0" y="0"/>
</Anchor>
</Anchors>
</HorizontalResizeImage>

<!-- Decorative dragons on the title bar-->
<DynamicImage name="$parentLeftDragon" texturescale="1" handleinput="false" layer="secondary">
<Size>
<AbsPoint x="140" y="30" />
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent">
<AbsPoint x="15" y="10" />
</Anchor>
</Anchors>
</DynamicImage>
<DynamicImage name="$parentRightDragon" texturescale="1" handleinput="false" layer="secondary">
<Size>
<AbsPoint x="150" y="30" />
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft">
<AbsPoint x="290" y="10" />
</Anchor>
</Anchors>
</DynamicImage>

<!-- Tab Windows -->
<Window name="$parentMainWindow">
<Size>
<AbsPoint x="470" y="600"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent" >
<AbsPoint x="0" y="1" />
</Anchor>
</Anchors>
<Windows>
<Window name="$ParentMain">
<Size>
<AbsPoint x="500" y="600"/>
</Size>
</Window>
</Windows>
</Window>
<Window name="$parentOtherWindow">
<Size>
<AbsPoint x="470" y="600"/>
</Size>
<Anchors>
<Anchor point="topleft" relativePoint="topleft" relativeTo="$parent" >
<AbsPoint x="0" y="1" />
</Anchor>
</Anchors>
<Windows>
<Window name="$ParentOther">
<Size>
<AbsPoint x="470" y="600"/>
</Size>
</Window>
</Windows>
</Window>
</Windows>
</Window>
</Windows>
</Interface>


********************** LUA FILE ***********************
--[[
Credits: After I did the initial release there have been several people contributing...
Sarphus: Original gump design, coding, layout, attempts at humor, etc
Flutter: Talked me into moving loyalty rating to the front page (she was right)
Gildar: Suggested structural changes in the code, which I eventually agreed to
Pinco: Helped me find and fix a bug that caused my gump to step on the character sheet gump

]]
--[[ This is a good place to store thresholds for critter types. Then all you have to do is copy/paste them into the current threshold when you switch from one critter to another.

Bake = { hp=325, str=200, dex=125, sta=125, int=400, mana=400, phys=57, fire=87, cold=55, pois=55, eng=57 }
RuneB = { hp=345, str=400, dex=150, sta=150, int=400, mana=400, phys=62, fire=48, cold=45, pois=90, eng=55 }
GIW = { hp=143, str=216, dex=150, sta=150, int=400, mana=400, phys=33, fire=48, cold=85, pois=20, eng=17 }
Hiryu = { hp=1000, str=1390, dex=150, sta=150, int=325, mana=65, phys=68, fire=88, cold=20, pois=45, eng=48 }
Dragon = { hp=487, str=815, dex=105, sta=105, int=460, mana=460, phys=63, fire=68, cold=38, pois=33, eng=43 }
WW = { hp=445, str=750, dex=130, sta=130, int=406, mana=406, phys=68, fire=23, cold=88, pois=48, eng=48 }
cu = { hp=1170, str=1220, dex=170, sta=170, int=285, mana=285, phys=60, fire=43, cold=80, pois=45, eng=80 }

]]


CurrentThreshold = { hp=325, str=200, dex=125, sta=125, int=400, mana=400, phys=57, fire=87, cold=55, pois=55, eng=57 }

-- Variables to store the stats.
-- NOTE: In a future build I may remove these and get the data directly from the data source. The data source looks like it is likely to change at some point in the not too distant future
AnimalLore.strSTR = L""
AnimalLore.strDEX = L""
AnimalLore.strINT = L""
AnimalLore.strHP = L""
AnimalLore.strStamina = L""
AnimalLore.strMana = L""
AnimalLore.strPhysRes = L""
AnimalLore.strFireRes = L""
AnimalLore.strColdRes = L""
AnimalLore.strPoisonRes = L""
AnimalLore.strEnergyRes = L""
AnimalLore.strWrestling = L""
AnimalLore.strAnatomy = L""
AnimalLore.strTactics = L""
AnimalLore.strResist = L""
AnimalLore.strMagery = L""
AnimalLore.strMeditation = L""
AnimalLore.strEvalInt = L""
AnimalLore.strHealPoison = L""
AnimalLore.strBardDifficulty = L""
AnimalLore.strDmgPhys = L""
AnimalLore.strDmgFire = L""
AnimalLore.strDmgCold = L""
AnimalLore.strDmgPoison = L""
AnimalLore.strDmgEnergy = L""
AnimalLore.strBaseDmg = L""
AnimalLore.strLoyalty = L""
AnimalLore.strPreferredFoods = L""
AnimalLore.strPackInstinct = L""

-- Generic TID dictionary IDs
TID_ID_LOYALTY_LABEL = 9
TID_ID_BARD_DIFFICULTY = 8
TID_ID_FOODS_LABEL = 34
TID_ID_FOODS_VALUE = 35
TID_ID_BASE_DMG_LABEL = 23
TID_ID_PACK_INSTINCT_LABEL = 36
TID_ID_PACK_INSTINCT_VALUE = 37
TID_ID_LOYALTY = 10

-- TID dictionary IDs for the resistances table
TID_ID_RESISTANCES = 11
TID_ID_PHYSICAL_RESIST = 12
TID_ID_FIRE_RESIST = 13
TID_ID_COLD_RESIST = 14
TID_ID_POISON_RESIST = 15
TID_ID_ENERGY_RESIST = 16

-- TID dictionary IDs for the damage types table
TID_ID_DAMAGE_TYPE = 17
TID_ID_PHYSICAL_DAMAGE = 18
TID_ID_FIRE_DAMAGE = 19
TID_ID_COLD_DAMAGE = 20
TID_ID_POISON_DAMAGE = 21
TID_ID_ENERGY_DAMAGE = 22

-- TID dictionary IDs for the statistics table
TID_ID_HEALTH = 2
TID_ID_STAMINA = 3
TID_ID_MANA = 4
TID_ID_STRENGTH = 5
TID_ID_DEXTERITY = 6
TID_ID_INTELLIGENCE = 7

-- TID dictionary IDs for the skills table
TID_ID_WRESTLING = 25
TID_ID_TACTICS = 26
TID_ID_RESIST = 27
TID_ID_ANATOMY = 28
TID_ID_POISONHEAL = 29
TID_ID_MAGERY = 31
TID_ID_EVAL_INT = 32
TID_ID_MEDITATION = 33

-- Icon IDs for the statistics table
ICON_ID_HEALTH = 742
ICON_ID_STAMINA = 750
ICON_ID_MANA = 746
ICON_ID_STRENGTH = 751
ICON_ID_DEXTERITY = 738
ICON_ID_INTELLIGENCE = 744

TID_SKILLS = 3000084 -- Skills isn't one of the strings passed down in the localization ids (TIDS) table, so I brought this one in manually. This is an actual TID, not a TID table index.

--*************FLAGS TO ENABLE/DISABLE OPTIONAL FEATURES*****************
AnimalLore.bolBypassHilighting = false -- set to true to bypass threshold checking
AnimalLore.bolDisplayDragons = false -- set to true to display the dragon graphics on the title bar
AnimalLore.bolDisplayCommas = false -- set to true to display commas on numbers with more than 4 digits
AnimalLore.bolSingleGump = true -- set to false to turn off the code that only allows one gump to be up at a time
AnimalLore.bolCalculateDmg = true -- set to true if you want calculate damage based on str/tactics/anatomy If false, base damage will be displayed
AnimalLore.bolReverseStrThreshold = false -- set to true if you want the threshold for str to be the maximum str value to hilight. This is used when you're looking for a really low str pet to maximize hp on the pet when fully trained.

function AnimalLore.Initialize()
local windowName = SystemData.ActiveWindow.name
local strInstance = string.sub(windowName,string.find(windowName,"-")+1)
local id = tonumber(strInstance)
local I = 1

-- Gump Initialization
WindowSetId(windowName, id)
Interface.DestroyWindowOnClose[windowName] = true
ButtonSetText( windowName.."MainTabButton", L"Main" )
ButtonSetText( windowName.."OtherTabButton", L"Other" )

-- Draw some dragons on the window caption
-- Note: These graphics will appear on top of pet names if the pet names are long enough
if AnimalLore.bolDisplayDragons then
DynamicImageSetTexture( windowName.."LeftDragon", "hud_image2", 365, 0 )
DynamicImageSetTexture( windowName.."RightDragon", "hud_image2", 350, 35 )
end

-- Populate the local data variables
AnimalLore.GetData()

--Debug.Print(GGManager.tableToString( WindowData.PlayerLocation ))
--Debug.Print(GGManager.tableToString( WindowData.CurrentTarget ))
--Debug.Print(GGManager.tableToString( Interface ))

--Restores the window position... the EA method for restoring window position isn't working on this gump, so I wrote one.
if id ~= 1 then
local windowPos = SystemData.Settings.Interface.WindowPositions
for intWinID, strWindowName in pairs(windowPos.Names) do
if( strWindowName == "AnimalLore") then
I = intWinID
break
end
end
local x,y = WindowGetOffsetFromParent("AnimalLore-"..(id-1))
windowPos.WindowPosX = x
windowPos.WindowPosY = y
end

--only keep one gump up at a time unless the user has single gumps turned off
if AnimalLore.bolSingleGump then
AnimalLore.KillOldGumps()
end

-- Plug the data for the entire gump into it's respective UI elements and display the main tab
AnimalLore.LoadMainPage()
AnimalLore.LoadOtherPage()
AnimalLore.OpenMainTab()
end

-- AnimalLore window shutdown event handler
function AnimalLore.Shutdown()
--if DoesWindowNameExist(WindowUtils.GetActiveDialog()) then
Debug.Print(WindowUtils.GetActiveDialog())
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id

WindowUtils.SaveWindowPosition(windowName, true, "AnimalLore")
DestroyWindow( windowName )
--end
end

--[[ Draws the data elements on the window for the "Main" tab
DESIGNER NOTE: If you want to move an attribute to the main tab page, just put the code for that attribute in this code block
and adjust its x/y coordinates on the "WindowAddAnchor" statement to position it ]]
function AnimalLore.LoadMainPage()
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id.."MainWindow"
local strAttribute = windowName.."BardDiff"

-- Toss bard difficulty up in the upper right corner of the main gump
AnimalLore.AddLabelGroupToForm(windowName, strAttribute, TranslateTID(TID_ID_BARD_DIFFICULTY), AnimalLore.strBardDifficulty, 260, 50)

-- NOTE: If you're just trying to move where the data appears, only change the last 2 numbers. If you want to change the icon, change the other number
-- I recommend leaving the other stuff alone
-- ***** DISPLAY STATS *****
AnimalLore.BuildStatisticsDisplay( windowName, 28, 90 )

-- ***** DISPLAY RESISTANCES *****
AnimalLore.BuildResistTypesDisplay( windowName, 30, 185 )

-- ***** DISPLAY SKILLS *****
AnimalLore.BuildSkillsDisplay( windowName, 0, 270 )

strAttribute = windowName.."LoyaltyDivider"
CreateWindowFromTemplate(strAttribute, "HRDef", windowName)
WindowAddAnchor(strAttribute, "topleft", windowName, "topleft", 4, 405)

strAttribute = windowName.."Loyalty"
AnimalLore.AddLabelGroupToForm(windowName, strAttribute, TranslateTID(TID_ID_LOYALTY_LABEL), AnimalLore.strLoyalty, 118, 420)
end

--[[ Draws the data elements on the window for the "Other" tab
DESIGNER NOTE: If you want to move an attribute to the second tab page, just put the code for that attribute in this code block
and adjust its x/y coordinates on the "WindowAddAnchor" statement to position it ]]
function AnimalLore.LoadOtherPage(parentWindowName)
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id.."OtherWindow"
local strAttribute = nil

strAttribute = windowName.."PrefFoods"
AnimalLore.AddLabelGroupToForm(windowName, strAttribute, TranslateTID(TID_ID_FOODS_LABEL), AnimalLore.strPreferredFoods, 30, 100)

strAttribute = windowName.."BaseDmg"
AnimalLore.AddLabelGroupToForm(windowName, strAttribute, TranslateTID(TID_ID_BASE_DMG_LABEL), AnimalLore.strBaseDmg, 30, 130)

strAttribute = windowName.."PackInstinct"
AnimalLore.AddLabelGroupToForm(windowName, strAttribute, TranslateTID(TID_ID_PACK_INSTINCT_LABEL), AnimalLore.strPackInstinct, 30, 160)

-- ***** DAMAGE TYPE *****
AnimalLore.BuildDamageTypesDisplay( windowName, 30, 200 )
end

-- Closes the "Other" tab and opens the "Main" tab
function AnimalLore.OpenMainTab()
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id

ButtonSetDisabledFlag( windowName.."OtherTabButton", false )
ButtonSetDisabledFlag( windowName.."MainTabButton", true )
WindowSetShowing( windowName.."MainTabButtonTab", false )
WindowSetShowing( windowName.."OtherTabButtonTab", true )
WindowSetShowing( windowName.."OtherWindow", false )
WindowSetShowing( windowName.."MainWindow", true )
end

-- Closes the "Main" tab and opens the "Other" tab
function AnimalLore.OpenOtherTab()
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id

ButtonSetDisabledFlag( windowName.."MainTabButton", false )
ButtonSetDisabledFlag( windowName.."OtherTabButton", true )
WindowSetShowing( windowName.."OtherTabButtonTab", false )
WindowSetShowing( windowName.."MainTabButtonTab", true )
WindowSetShowing( windowName.."MainWindow", false )
WindowSetShowing( windowName.."OtherWindow", true )
end

-- Fetches all the data the Animal Lore gump needs and stores it in more human-readable data structure
function AnimalLore.GetData()
local id = WindowGetId(WindowUtils.GetActiveDialog())
local windowName = "AnimalLore-"..id
local statsTable = WindowData.GG_Core.stringData

-- Skills
AnimalLore.strAnatomy = WindowUtils.translateMarkup(statsTable[1])
AnimalLore.strHealPoison = WindowUtils.translateMarkup(statsTable[2])
AnimalLore.strResist = WindowUtils.translateMarkup(statsTable[3])
AnimalLore.strTactics = WindowUtils.translateMarkup(statsTable[4])
AnimalLore.strWrestling = WindowUtils.translateMarkup(statsTable[5])
AnimalLore.strEvalInt = WindowUtils.translateMarkup(statsTable[6])
AnimalLore.strMagery = WindowUtils.translateMarkup(statsTable[7])
AnimalLore.strMeditation = WindowUtils.translateMarkup(statsTable[8])

-- Name of the creature being Lored
WindowUtils.SetWindowTitle( windowName, WindowUtils.translateMarkup(statsTable[9]) )

-- STATS
AnimalLore.strSTR = WindowUtils.translateMarkup(statsTable[10])
AnimalLore.strHP = AnimalLore.DropToSingleStat(WindowUtils.translateMarkup(statsTable[11]))
AnimalLore.strDEX = WindowUtils.translateMarkup(statsTable[12])
AnimalLore.strStamina =AnimalLore.DropToSingleStat(WindowUtils.translateMarkup(statsTable[13]))
AnimalLore.strINT = WindowUtils.translateMarkup(statsTable[14])
AnimalLore.strMana = AnimalLore.DropToSingleStat(WindowUtils.translateMarkup(statsTable[15]))

-- Resists
AnimalLore.strPhysRes = WindowUtils.translateMarkup(statsTable[17])
AnimalLore.strFireRes = WindowUtils.translateMarkup(statsTable[18])
AnimalLore.strColdRes = WindowUtils.translateMarkup(statsTable[19])
AnimalLore.strPoisonRes = WindowUtils.translateMarkup(statsTable[20])
AnimalLore.strEnergyRes = WindowUtils.translateMarkup(statsTable[21])

-- Damage
AnimalLore.strDmgPhys = AnimalLore.DropBlanks(WindowUtils.translateMarkup(statsTable[22]))
AnimalLore.strDmgFire = AnimalLore.DropBlanks(WindowUtils.translateMarkup(statsTable[23]))
AnimalLore.strDmgCold = AnimalLore.DropBlanks(WindowUtils.translateMarkup(statsTable[24]))
AnimalLore.strDmgPoison = AnimalLore.DropBlanks(WindowUtils.translateMarkup(statsTable[25]))
AnimalLore.strDmgEnergy = AnimalLore.DropBlanks(WindowUtils.translateMarkup(statsTable[26]))

AnimalLore.strBardDifficulty = WindowUtils.translateMarkup(statsTable[16])

-- Calculates dmg adjusted for stats
AnimalLore.strBaseDmg = WindowUtils.translateMarkup(statsTable[27])
if AnimalLore.bolCalculateDmg then
local min, max = AnimalLore.CalcDmgAdjustedForStats()
AnimalLore.strBaseDmg = L""..math.floor(min)..L"-"..math.floor(max)
end

AnimalLore.strLoyalty = TranslateTID(TID_ID_LOYALTY)
AnimalLore.strPreferredFoods = TranslateTID(TID_ID_FOODS_VALUE)
AnimalLore.strPackInstinct = TranslateTID(TID_ID_PACK_INSTINCT_VALUE)
end

-- Takes a Wstring, returns a Wstring.
-- Drops the "/" out of stats
function AnimalLore.DropToSingleStat(wstrStat)
local strTemp = WStringToString(wstrStat)

if (wstrStat ~= nil) and (wstrStat ~= L"---") then
strTemp = string.sub(strTemp,string.find(strTemp,"/")+1)
end
return StringToWString(strTemp)
end

-- This Method replaces the "---" strings with empty strings :: Used to format damage type values
function AnimalLore.DropBlanks(wstrStat)
if wstrStat == L"---" then
return L""
else
return wstrStat
end
end

-- Converts a wide string to a numerical value
function AnimalLore.wstrToNumber(wstrValue)
intReturn = 0
if wstrValue ~= nil then
intReturn = tonumber(WStringToString(wstrValue))
end
return intReturn
end

-- Kills all instances of the Animal lore gump that aren't the current one
function AnimalLore.KillOldGumps()
local id = WindowGetId(WindowUtils.GetActiveDialog())
local intMin = id - 10
local strDeleteThisWindow = nil
local i = nil

if intMin <= 0 then
intMin = 1
end

for i = intMin, id-1 do
strDeleteThisWindow = "AnimalLore-"..i
DestroyWindow(strDeleteThisWindow)
end
end

--[[
**********************
* Tables Helper Code *
**********************
]]
-- This handles localization
function TranslateTID(intID)
local tidTable = WindowData.GG_Core.desc
local tid = tidTable[intID]
return GetStringFromTid(tonumber(tid))
end

-- Draws a label and a data field to the form. This method does exactly what add attribute does except it does not include any images
function AnimalLore.AddLabelGroupToForm(windowName, strAttribute, wstrLabel, wstrValue, intAnchorX, intAnchorY)
CreateWindowFromTemplate(strAttribute, "LabeledDataTemplate", windowName)
WindowAddAnchor(strAttribute, "topleft", windowName, "topleft", intAnchorX, intAnchorY)
LabelSetText(strAttribute.."Label", wstrLabel)
LabelSetText(strAttribute.."Value", wstrValue)
end

-- Calculates the left coordinate of an element, assuming equal spacing in a table
function AnimalLore.ElementLeft( left, columns, columnWidth, elementNumber )
return left + ( elementNumber % columns ) * columnWidth
end

-- Calculates the top coordinate of an element, assuming equal spacing in a table
function AnimalLore.ElementTop( top, columns, rowHeight, elementNumber )
return top + math.floor( elementNumber / columns ) * rowHeight
end

--[[
*************************
* Statistics Table Code *
*************************
]]

-- Builds the table that displays the animal's statistics
function AnimalLore.BuildStatisticsDisplay( windowName, left, top )
local rowHeight = 30
local columnWidth = 190
local columns = 2
local entries = 0

AnimalLore.AddAttributeToForm( windowName, windowName.."STR", TranslateTID( TID_ID_STRENGTH ),
AnimalLore.strSTR, CurrentThreshold.str, ICON_ID_STRENGTH,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddAttributeToForm( windowName, windowName.."HP", TranslateTID( TID_ID_HEALTH ),
AnimalLore.strHP, CurrentThreshold.hp, ICON_ID_HEALTH,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddAttributeToForm( windowName, windowName.."DEX", TranslateTID( TID_ID_DEXTERITY ),
AnimalLore.strDEX, CurrentThreshold.dex, ICON_ID_DEXTERITY,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddAttributeToForm( windowName, windowName.."STA", TranslateTID( TID_ID_STAMINA ),
AnimalLore.strStamina, CurrentThreshold.sta, ICON_ID_STAMINA,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddAttributeToForm( windowName, windowName.."INT", TranslateTID( TID_ID_INTELLIGENCE ),
AnimalLore.strINT, CurrentThreshold.int, ICON_ID_INTELLIGENCE,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddAttributeToForm( windowName, windowName.."MANA", TranslateTID( TID_ID_MANA ),
AnimalLore.strMana, CurrentThreshold.mana, ICON_ID_MANA,
AnimalLore.ElementLeft( left, columns, columnWidth, entries ),
AnimalLore.ElementTop( top, columns, rowHeight, entries ) )
entries = entries + 1
end

-- Draws an attribute for stats at the top of the form
function AnimalLore.AddAttributeToForm(windowName, strAttribute, wstrLabel, wstrValue, intThreshold, intIconID, intAnchorX, intAnchorY)
CreateWindowFromTemplate(strAttribute, "AttributeDisplayTemplate", windowName)
WindowAddAnchor(strAttribute, "topleft", windowName, "topleft", intAnchorX, intAnchorY)
LabelSetText(strAttribute.."AttributeName", wstrLabel)
if AnimalLore.bolDisplayCommas then
LabelSetText(strAttribute.."AttributeValue", WindowUtils.AddCommasToNumber(wstrValue))
else
LabelSetText(strAttribute.."AttributeValue", wstrValue)
end

if (wstrValue ~= L"---") and (wstrValue ~= nil) then
if AnimalLore.bolReverseStrThreshold and intIconID == ICON_ID_STRENGTH then
if tonumber(WStringToString(wstrValue)) <= intThreshold and (AnimalLore.bolBypassHilighting == false) then
AnimalLore.SetSqaureIconStats(strAttribute, intIconID)
LabelSetFont( strAttribute.."AttributeName", "UO_GoldButtonText", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
LabelSetFont( strAttribute.."AttributeValue", "UO_Title", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
end
else
if tonumber(WStringToString(wstrValue)) >= intThreshold and (AnimalLore.bolBypassHilighting == false) then
AnimalLore.SetSqaureIconStats(strAttribute, intIconID)
LabelSetFont( strAttribute.."AttributeName", "UO_GoldButtonText", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
LabelSetFont( strAttribute.."AttributeValue", "UO_Title", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
end
end
end
end

--[[ I ripped this code out of the character sheet gump
It basically takes an icon by its index and trims off a specific portion of that icon to display it ]]
function AnimalLore.SetSqaureIconStats(iconWindow, iconId)
local texture, x, y = GetIconData( iconId )

--Start position of the texture, need to be offset by x and y to get the stat icon image
x = 4
y = 3
WindowSetDimensions(iconWindow.."SquareIcon", 27, 27)
DynamicImageSetTexture( iconWindow.."SquareIcon", texture, x, y )
end

--[[
**************************
* Resistances Table Code *
**************************
]]
-- Builds the table that displays the animal's resistances
function AnimalLore.BuildResistTypesDisplay( windowName, left, top )
local resistWindow = windowName.. "Resists"
CreateWindowFromTemplate( resistWindow, "ResistGridTemplate", windowName )
WindowAddAnchor( resistWindow, "topleft", windowName, "topleft", left, top )
LabelSetText( resistWindow.."TableCaption", TranslateTID( TID_ID_RESISTANCES ) )

AnimalLore.FormatResistData( resistWindow.."Phys", TranslateTID( TID_ID_PHYSICAL_RESIST ),
AnimalLore.strPhysRes, CurrentThreshold.phys )

AnimalLore.FormatResistData( resistWindow.."Fire", TranslateTID( TID_ID_FIRE_RESIST ),
AnimalLore.strFireRes, CurrentThreshold.fire )

AnimalLore.FormatResistData( resistWindow.."Cold", TranslateTID( TID_ID_COLD_RESIST ),
AnimalLore.strColdRes, CurrentThreshold.cold )

AnimalLore.FormatResistData( resistWindow.."Poison", TranslateTID( TID_ID_POISON_RESIST ),
AnimalLore.strPoisonRes, CurrentThreshold.pois )

AnimalLore.FormatResistData( resistWindow.."Energy", TranslateTID( TID_ID_ENERGY_RESIST ),
AnimalLore.strEnergyRes, CurrentThreshold.eng )
end

-- Sets properties on xml elements that handle displaying resistances & handling hilighted states
function AnimalLore.FormatResistData(strAttribute, wstrLabel, wstrValue, intThreshold)
if (wstrValue == L"---") or (wstrValue == nil) then
LabelSetText(strAttribute.."Header", wstrLabel)
LabelSetText(strAttribute.."Value", L"")
else
local strTemp = WStringToString(wstrValue)

strTemp = string.gsub(strTemp, "%%", "")

wstrValue = StringToWString(strTemp)
LabelSetText(strAttribute.."Header", wstrLabel)
LabelSetText(strAttribute.."Value", wstrValue)

-- Threshold checking
if AnimalLore.bolBypassHilighting == false then
if tonumber(strTemp) >= intThreshold then
DynamicImageSetTexture( strAttribute.."Hilight", "UO_Common", 385, 190 )
LabelSetTextColor( strAttribute.."Header", 0, 0, 0)
LabelSetTextColor( strAttribute.."Value", 0, 0, 0)
LabelSetFont( strAttribute.."Header", "UO_GoldButtonText", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
LabelSetFont( strAttribute.."Value", "UO_Title", WindowUtils.FONT_DEFAULT_TEXT_LINESPACING )
end
end
end
end

--[[
***************************
* Damage Types Table Code *
***************************
]]
-- Builds the table that displays the animal's resistances
function AnimalLore.BuildDamageTypesDisplay( windowName, left, top )
local dmgTypeWindowName = windowName.. "DmgType"
CreateWindowFromTemplate( dmgTypeWindowName, "ResistGridTemplate", windowName )
WindowAddAnchor( dmgTypeWindowName, "topleft", windowName, "topleft", left, top )
LabelSetText( dmgTypeWindowName.."TableCaption", TranslateTID( TID_ID_DAMAGE_TYPE ) )

local strAttribute = dmgTypeWindowName.."Phys"
LabelSetText(strAttribute.."Header", TranslateTID( TID_ID_PHYSICAL_DAMAGE ))
LabelSetText(strAttribute.."Value", AnimalLore.strDmgPhys)

strAttribute = dmgTypeWindowName.."Fire"
LabelSetText(strAttribute.."Header", TranslateTID( TID_ID_FIRE_DAMAGE ))
LabelSetText(strAttribute.."Value", AnimalLore.strDmgFire)

strAttribute = dmgTypeWindowName.."Cold"
LabelSetText(strAttribute.."Header", TranslateTID( TID_ID_COLD_DAMAGE ))
LabelSetText(strAttribute.."Value", AnimalLore.strDmgCold)

strAttribute = dmgTypeWindowName.."Poison"
LabelSetText(strAttribute.."Header", TranslateTID( TID_ID_POISON_DAMAGE ))
LabelSetText(strAttribute.."Value", AnimalLore.strDmgPoison)

strAttribute = dmgTypeWindowName.."Energy"
LabelSetText(strAttribute.."Header", TranslateTID( TID_ID_ENERGY_DAMAGE ))
LabelSetText(strAttribute.."Value", AnimalLore.strDmgEnergy)
end

--[[
********************
* Skill Table Code *
********************
]]
-- Builds the table that displays the animal's skills
function AnimalLore.BuildSkillsDisplay( windowName, left, top )
local rowHeight = 25
local columnWidth = 210
local columns = 2
local entries = 0
local skillsLeft = left + 50
local skillsTop = top + 30

local strAttribute = windowName.."SkillsSectionCaption"
CreateWindowFromTemplate( strAttribute, "TableCaptionTemplate", windowName )
WindowAddAnchor( strAttribute, "topleft", windowName, "topleft", left, top )
LabelSetText( strAttribute, GetStringFromTid( TID_SKILLS ) )

strAttribute = windowName.."SkillsDivider"
CreateWindowFromTemplate( strAttribute, "HRDef", windowName )
WindowAddAnchor( strAttribute, "topleft", windowName, "topleft", left + 4, top + 22 )

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Wrestling",
TranslateTID( TID_ID_WRESTLING ), AnimalLore.strWrestling,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Magery",
TranslateTID( TID_ID_MAGERY ), AnimalLore.strMagery,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Tactics",
TranslateTID( TID_ID_TACTICS ), AnimalLore.strTactics,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

-- The localized string says "Evaluating Intelligence, which is really ugly in my layout, so I change it...
-- if the gump isn't processed in English I may have a layout issue here because of my kludge, but I'm leaving that up to any foreign language modders to fix.
local wstrEvalIntTemp = TranslateTID( TID_ID_EVAL_INT )
if wstrEvalIntTemp == L"Evaluating Intelligence" then
wstrEvalIntTemp = L"Eval Int"
end
AnimalLore.AddLabelGroupToForm( windowName, windowName.."Eval",
wstrEvalIntTemp, AnimalLore.strEvalInt,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Anatomy",
TranslateTID( TID_ID_ANATOMY ), AnimalLore.strAnatomy,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Meditation",
TranslateTID( TID_ID_MEDITATION ), AnimalLore.strMeditation,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

AnimalLore.AddLabelGroupToForm( windowName, windowName.."Resist",
TranslateTID( TID_ID_RESIST ), AnimalLore.strResist,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1

wstrPoisoningHealing = TranslateTID( TID_ID_POISONHEAL )
AnimalLore.AddLabelGroupToForm( windowName, windowName.."PoisoningHealing",
wstrPoisoningHealing, AnimalLore.strHealPoison,
AnimalLore.ElementLeft( skillsLeft, columns, columnWidth, entries ),
AnimalLore.ElementTop( skillsTop, columns, rowHeight, entries ) )
entries = entries + 1
end

--[[
*********************
* Stat Calculations *
*********************
]]
-- Calculates damage based on the stats the creature has
function AnimalLore.CalcDmgAdjustedForStats()
local intStr = AnimalLore.wstrToNumber(AnimalLore.strSTR)
local intAnatomy = AnimalLore.wstrToNumber(AnimalLore.strAnatomy)
local intTactics = AnimalLore.wstrToNumber(AnimalLore.strTactics)
local dblStrBonus = intStr * .3
local dblAnatomyBonus = (intAnatomy / 2) + 5
local dblTacticsBonus = intTactics / 1.6
local strTemp = WStringToString(AnimalLore.strBaseDmg)
local intBaseMin = tonumber(string.sub(strTemp,1,string.find(strTemp,"-")-1))
local intBaseMax = tonumber(string.sub(strTemp,string.find(strTemp,"-")+1))
local dblDmgModifier = nil
local intAdjustedMin = nil
local intAdjustedMax = nil

if intStr >= 125 then
dblStrBonus = dblStrBonus + 5
end
if intTactics >= 100 then
dblTacticsBonus = dblTacticsBonus + 6.25
end
dblDmgModifier = (dblStrBonus + dblAnatomyBonus + dblTacticsBonus)

intAdjustedMin = intBaseMin + (intBaseMin * dblDmgModifier) * .01
intAjustedMax = intBaseMax + (intBaseMin * dblDmgModifier )* .01

return intAdjustedMin, intAjustedMax
end
 
I

imported_Sarphus

Guest
PS

What you want to do is copy/paste the xml code into notepad and save it as AnimalLore.xml

then copy/paste the lua code into notepad and name it AnimalLore.lua

Then you just move those 2 files into "UserInterface\Mods\Source\Generic" and select "Mods" as your custom mod.
 
I

imported_onthefifty

Guest
theres a period missing in line 47

*smiles*
 
G

Guest

Guest
<blockquote><hr>

PS

What you want to do is copy/paste the xml code into notepad and save it as AnimalLore.xml

then copy/paste the lua code into notepad and name it AnimalLore.lua

Then you just move those 2 files into "UserInterface\Mods\Source\Generic" and select "Mods" as your custom mod.

[/ QUOTE ]

Ok, followed directions and when I use the Lore skill the gump does not appear. The original works fine when selected but not the mod.
 
G

Guest

Guest
Thy for help Sarphus but this is not working only get a little bigger blank window.
 
Top