Facebook
From Soft Marten, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 290
  1. ;=========================================
  2. ; Script Name: Uncle Dave's Tamer Plus
  3. ; Author: Uncle Dave
  4. ; Version: 4.2
  5. ; Client Tested with: 4.0.9b
  6. ; EUO version tested with: 1.42.00A3
  7. ; Shard OSI / FS: OSI Tested Only
  8. ; Revision Date: 3/24/2005
  9. ; Public Release: 6/10/2004
  10. ; Global Variables Used: None
  11. ; Purpose: Finds animals that will give
  12. ; you the best gains and tames the closest
  13. ; animal to your current location.
  14. ;=========================================
  15. ;
  16. ; The following table was generated from data gathered off the UO Stratics
  17. ; taming page. Analysing their results produces a success rate calculation
  18. ; based upon the character's Animal Taming skill only. Modifying the Animal
  19. ; Lore did not produce any noticable changes in the success rates.
  20. ;
  21. ; The formula determined for calculating success rate is R = (S - B) * 2 where
  22. ; R is the success rate, S is the character's taming skill, and B is the
  23. ; minumum skill required to tame minus 0.1 (this is the base skill
  24. ; requirement). Using basic algebra and solving for S provides a formula that
  25. ; can can be used calculate the skill required to achieve a specific success
  26. ; rate (S = R / 2 + B). This formula is used in the table below to determine
  27. ; which creatures will provide the best chances to recieve a gain while
  28. ; taming.
  29. ;
  30. ; Column descriptions:
  31. ;
  32. ; ANIMAL    The name of the animal to tame
  33. ; REQ SKILL The minimum skill required to tame
  34. ; MIN GAIN  The skill level that has a 10% success rate
  35. ; MAX GAIN  The skill level that has an 90% success rate
  36. ; C/M       Monster (Yes/No)
  37. ; TYPE      EasyUO FindItem type for animal
  38. ;
  39. ;                      REQ    MIN    MAX
  40. ; ANIMAL             SKILL   GAIN   GAIN  C/M  TYPE
  41. ; -----------------  -----  -----  -----  ---  ----
  42. ; Dog                -21.3    -17     23   N   HG
  43. ; Gorilla            -18.9    -14     26   N   RD
  44. ; Jack Rabbit        -18.9    -14     26   N   NF
  45. ; Mongbat            -18.9    -14     26   Y   BE
  46. ; Rabbit             -18.9    -14     26   N   NF
  47. ; Skittering Hopper  -12.9     -8     32   N   GO
  48. ; Bird                -6.9     -2     38   N   WC
  49. ; Cat                 -0.9      4     44   N   RF
  50. ; Chicken             -0.9      4     44   N   AG
  51. ; Mountain Goat       -0.9      4     44   N   KB
  52. ; Rat                 -0.9      4     44   N   WG
  53. ; Sewer Rat           -0.9      4     44   N   WG
  54. ; Cow                 11.1     16     56   N   IG_NG
  55. ; Goat                11.1     16     56   N   ZF
  56. ; Pig                 11.1     16     56   N   JF
  57. ; Sheep               11.1     16     56   N   TF_PF
  58. ; Eagle               17.1     22     62   N   TC
  59. ; Bullfrog            23.1     28     68   N   BB
  60. ; Hind                23.1     28     68   N   TG
  61. ; Slime               23.1     28     68   Y   VE
  62. ; Timber Wolf         23.1     28     68   N   PG
  63. ; Boar                29.1     34     74   N   CO
  64. ; Desert Ostard       29.1     34     74   N   CG
  65. ; Forest Ostard       29.1     34     74   N   JG
  66. ; Giant Beetle        29.1     34     74   Y   ZGB
  67. ; Giant Rat           29.1     34     74   N   XF
  68. ; Horse               29.1     34     74   N   SF_MG_SG_OF
  69. ; Pack Horse          29.1     34     74   N   BO
  70. ; Pack Llama          29.1     34     74   N   WN
  71. ; Rideable Llama      29.1     34     74   N   EG
  72. ; War Horse           29.1     34     74   N   QC
  73. ; Black Bear          35.1     40     80   N   BG
  74. ; Llama               35.1     40     80   N   EG
  75. ; Polar Bear          35.1     40     80   N   VF
  76. ; Walrus              35.1     40     80   N   DG
  77. ; Brown Bear          41.1     46     86   N   ZI
  78. ; Cougar              41.1     46     86   N   ZE
  79. ; Deathwatch Beetle   41.1     46     86   Y   IH
  80. ; Alligator           47.1     52     92   N   UF
  81. ; Scorpion            47.1     52     92   Y   UE
  82. ; Grey Wolf           53.1     58     98   N   VD
  83. ; Panther             53.1     58     98   N   YF_DG
  84. ; Snow Leopard        53.1     58     98   N   L_M_YF_DG
  85. ; Giant Spider        59.1     64    104   Y   SD
  86. ; Great Hart          59.1     64    104   N   AH
  87. ; Grizzly Bear        59.1     64    104   N   WF
  88. ; Snake               59.1     64    104   N   QE
  89. ; White Wolf          65.1     70    110   N   GE_ZD_L_M_YF_DG
  90. ; Gaman               68.7     73    113   N   OH
  91. ; Bull                71.1     76    116   N   YG_XG
  92. ; Giant Ice Worm      71.1     76    116   N  
  93. ; Hellcat (Small)     71.1     76    116   Y   RF
  94. ; Mongbat (Strong)    71.1     76    116   Y  
  95. ; Frost Spider        74.7     79    119   Y   KD
  96. ; Frenzied Ostard     77.1     82    122   N   KG
  97. ; Giant Toad          77.1     82    122   N   CB
  98. ; Bake Kitsune        80.7     85    125   Y   EH
  99. ; Lava Lizard         80.7     85    125   Y   QF
  100. ; Dire Wolf           83.1     88    128   N   LD
  101. ; Imp                 83.1     88    128   Y   W
  102. ; Ridgeback           83.1     88    128   N   WJ
  103. ; Savage Ridgeback    83.1     88    128   N  
  104. ; Drake               84.3     89    129   Y   YE_XE
  105. ; Hell Hound          85.5     90    130   Y   UB
  106. ; Hellcat (Large)     89.1     94    134   Y   NC
  107. ; Dragon              93.9     98    138   Y   CD_DF
  108. ; Fire Beetle         93.9     98    138   Y   JJ
  109. ; Rune Beetle         93.9     98    138   Y   CH
  110. ; Swamp Dragon        93.9     98    138   Y   MHB
  111. ; Ki-Rin              95.1    100    140   Y   SH
  112. ; Nightmare           95.1    100    140   Y   TJ
  113. ; Unicorn             95.1    100    140   Y   SC
  114. ; White Wyrm          96.3    101    141   Y   TE
  115. ; Hiryu               98.7    103    143   Y   HH
  116. ; Lesser Hiryu        98.7    103    143   Y   HH
  117. ; Fire Steed           106    110    150   Y   YJ
  118. ;
  119. ; TAMING MESSAGES
  120. ; It's too far away.
  121. ; You can't see that.
  122. ; You can't tame that!
  123. ; That animal looks tame already.
  124. ; That creature cannot be tamed.
  125. ; Someone else is already taming that creature.
  126. ; You have too many followers to tame that creature.
  127. ; You have no chance of taming this creature.
  128. ; You seem to anger the beast.
  129. ; *You start to tame the creature.*
  130. ; You fail to tame the creature.
  131. ; You are too far away to continue taming.
  132. ; You do not have a clear path to the animal you are taming, and must cease your attempt.
  133. ; The animal is too angry to continue taming.
  134. ; The animal has been distracted, and you cannot continue taming.
  135. ; It seems to accept you as master.
  136. ; <petname> appears to have decided that it is better off without a master!
  137. ;
  138. initevents
  139. gosub InitMenu
  140. gosub InitAnimalTaming
  141. gosub InitPickupRegs
  142.  
  143. loop:
  144. gosub Dispatch
  145. goto loop
  146.  
  147. sub InitMenu
  148.     menu clear
  149.     menu window title Uncle Dave's Tamer Plus 4.2
  150.     menu window size 320 300
  151.     menu window color $E0E0E0
  152.     menu font bgcolor $E0E0E0
  153.     menu font name MS Sans Serif
  154.     menu font size 8
  155.     menu font style b
  156.     menu text lblmovement 10 5 Features
  157.     menu font style n
  158.     menu check autotame 10 20 130 15 #false Auto Tame Creatures
  159.     menu check pickupregs 10 35 130 15 #false Pickup Reagents
  160.     menu font style b
  161.     menu text lblrelease 10 55 Release Option
  162.     menu font style n
  163.     menu check releasecontext 10 70 130 15 #false Context Menu
  164.     menu check releaserename 10 85 130 15 #false Rename & Release
  165.     menu check relrenonly 10 100 130 15 #false Rename & Release only
  166.  
  167.     menu check releasekill 10 115 130 15 #false Mage/Necro Kill
  168.     menu font style b
  169.     menu text lblmisc 10 130 Character Movement
  170.     menu font style n
  171.     menu check dontmove 10 144 130 15 #false Don't Move Character
  172.     menu check returnstart 10 160 130 15 #false Return To Start
  173.  
  174.     menu font style b
  175.     menu text lblstatistics 150 5 Statistics
  176.     menu font style n
  177.     menu text lbltameskill 150 20 Animal Taming:
  178.     menu text lblloreskill 150 35 Animal Lore:
  179.     menu text lbltameid 150 50 Animal Id:
  180.     menu text lbltamecount 150 65 Attempts:
  181.     menu font align right
  182.     menu text tameskill 310 20 0/0
  183.     menu text loreskill 310 35 0/0
  184.     menu text tameid 310 50 N/A
  185.     menu text tamecount 310 65 0
  186.     menu font align left
  187.     menu button manualtame 150 90 80 25 Manual Tame
  188.     menu button resetstart 150 115 80 25 Reset Start
  189.     menu button ignorecurrent 230 90 80 25 Ignore Current
  190.     menu button resetignore 230 115 80 25 Reset Ignore
  191.     menu button setregcont 150 140 160 25 Set Reagent Container
  192.     menu shape bgstatus 0 175 320 17 3 7 1 $999999 7 $E0E0E0
  193.     menu font color $666666
  194.     menu text lblstatus 5 177 Status:
  195.     menu text status 40 177 Initializing
  196.     gosub MenuUpdateStats
  197.     menu show
  198.     menu HideEUO
  199.     set #menubutton N/A
  200. return
  201.  
  202. sub InitAnimalTaming
  203.     event macro 8 2 ; open status
  204.     wait 1s
  205.     set %statusposx #contposx
  206.     set %statusposy #contposy
  207.     set %charstartx #charposx
  208.     set %charstarty #charposy
  209.     set %charstartz #charposz
  210.     set %tameskill -1
  211.     set %tameigtimer 0
  212.     set %tamecount 0
  213.     set %tameid N/A
  214. return
  215.  
  216. sub InitPickupRegs
  217.     set %reagents KUF_JUF_MZF_JZF_KZF_WZF_RZF_SZF
  218.     event macro 8 7 ; open backpack
  219.     wait 1s
  220. return
  221.  
  222. sub Dispatch
  223.     menu set status Idle
  224.     gosub ScriptIdletime
  225.     gosub TamingCheckSkill
  226.     set %finditems N/A
  227.     menu get autotame
  228.     if #menures = #true
  229.     {
  230.         gosub TamingIgnore reset
  231.         set %finditems %tameable
  232.     }
  233.     menu get pickupregs
  234.     if #menures = #true
  235.     {
  236.         if %finditems = N/A
  237.             set %finditems %reagents
  238.         else
  239.             set %finditems %finditems , _ , %reagents
  240.     }
  241.     gosub FindClosestItem %finditems
  242.     if %finddist = N/A
  243.     {
  244.         menu get returnstart
  245.         if #menures = #true
  246.         {
  247.             gosub PathfindWait %charstartx %charstarty %charstartz
  248.             if %moveres = error
  249.                 menu set returnstart #false
  250.         }
  251.     }
  252.     if %finddist <> N/A
  253.     {
  254.         if %findtype in %tameable
  255.             gosub Taming %findid
  256.         if %findtype in %reagents
  257.             gosub PickupRegs %findid
  258.     }
  259. return
  260.  
  261. sub ScriptIdletime
  262.     if #menubutton = manualtame 2
  263.         set #menubutton N/A
  264.         gosub TamingManual
  265.     if #menubutton = resetignore 2
  266.         set #menubutton N/A
  267.         ignoreitem reset
  268.     if #menubutton = resetstart 4
  269.         set #menubutton N/A
  270.         set %charstartx #charposx
  271.         set %charstarty #charposy
  272.         set %charstartz #charposz
  273.     if #menubutton = setregcont 2
  274.         set #menubutton N/A
  275.         gosub SetReagentContainer
  276.     gosub MenuUpdateStats
  277.     gosub PickupRegsNearby
  278. return
  279.  
  280. sub MenuUpdateStats
  281.     chooseskill anim
  282.     str right #skill 1
  283.     set %_skilldec #strres
  284.     set %_skill #skill / 10
  285.     set %_skillcap #skillcap / 10
  286.     menu set tameskill %_skill , #dot , %_skilldec , / , %_skillcap
  287.     chooseskill anil
  288.     str right #skill 1
  289.     set %_skilldec #strres
  290.     set %_skill #skill / 10
  291.     set %_skillcap #skillcap / 10
  292.     menu set loreskill %_skill , #dot , %_skilldec , / , %_skillcap
  293.     menu set tameid %tameid
  294.     menu set tamecount %tamecount
  295. return
  296.  
  297. sub Taming
  298.     if #followers >= #maxfol
  299.     {
  300.         display ok You have too many followers
  301.         menu set autotame #false
  302.         return
  303.     }
  304.     finditem %1 G_16
  305.     if #findkind = -1
  306.         return
  307.     set %tameid #findid
  308.     set %tametype #findtype
  309.     set %tamedist #finddist
  310.     if %tameid <> #ltargetid
  311.         event exmsg %tameid 3 30 Pick me!
  312.     set %tamecount 0
  313.     gosub MenuUpdateStats
  314.     gosub TameAnimal
  315.     set %tameid N/A
  316. return
  317.  
  318. sub TamingManual
  319.     if %tameid <> N/A
  320.     {
  321.         event sysmessage You are already taming something.
  322.         return
  323.     }
  324.     menu set status Waiting For Target
  325.     gosub GetTargetId
  326.     gosub Taming #ltargetid
  327. return
  328.  
  329. sub TamingCheckSkill
  330.     menu get autotame
  331.     if #menures = #false
  332.         return
  333.     chooseskill anim
  334.  
  335.     if %tameskill = #skill
  336.         return
  337.     set %tameskill #skill
  338.     ; ---------------------------------------------------
  339.     ; this chart was auto-generated using TamingChart.xls
  340.     ; ---------------------------------------------------
  341.     ; wyspa
  342. if %tameskill >= 0 && %tameskill < 720
  343.         set %tameable GE_ZD_L_M_YF_DG
  344. ;bulle
  345.     if %tameskill >= 720 && %tameskill < 960
  346.         set %tameable YG_XG
  347. ;unikorn
  348.     if %tameskill >= 960 && %tameskill < 1200
  349.         set %tameable SC
  350.  
  351.     gosub TamingIgnore gain
  352. return
  353.  
  354. sub TamingIgnore
  355.     if %1 = perm
  356.     {
  357.         ignoreitem %2
  358.         return
  359.     }
  360.     if %1 = temp
  361.     {
  362.         ignoreitem %2 1
  363.         set %tameigtimer #systime + 60000
  364.         return
  365.     }
  366.     if %1 = reset && #systime > %tameigtimer
  367.     {
  368.         ignoreitem reset 1
  369.         return
  370.     }
  371.     if %1 = skill
  372.     {
  373.         ignoreitem %2 2
  374.         return
  375.     }
  376.     if %1 = gain
  377.     {
  378.         ignoreitem reset 2
  379.         return
  380.     }
  381. return
  382.  
  383. sub TameAnimal
  384.     menu set status Starting To Tame
  385.     TamingLoop:
  386.     finditem %tameid G_16
  387.     if #findkind = -1
  388.        {
  389.  
  390.  
  391.  
  392.            return
  393.        }
  394.     if #finddist > 2
  395.     {
  396.         menu set status Too Far Away
  397.         gosub PathfindWait #findx #findy #findz
  398.         if %moveres = error
  399.         {
  400.             gosub TamingIgnore temp %tameid
  401.             return
  402.         }
  403.         if #menubutton = ignorecurrent
  404.         {
  405.             set #menubutton N/A
  406.             gosub TamingIgnore perm %tameid
  407.             return
  408.         }
  409.         gosub ScriptIdletime
  410.         goto TamingLoop
  411.     }
  412.     set %tamecount %tamecount + 1
  413.     set %tamejournal #jindex + 1
  414.     set %tamefollow #followers
  415.     set #ltargetid %tameid
  416.     set #ltargetkind 1
  417.     event macro 13 35 ; animal taming
  418.     target 2s
  419.     event macro 22 0 ; last target
  420.     gosub TamingMonitor
  421.     if #result = success
  422.     {
  423.         gosub TamingRelease
  424.         gosub TamingIgnore perm %tameid
  425.         return
  426.     }
  427.     if #result = retry
  428.     {
  429.         gosub ScriptIdletime
  430.         goto TamingLoop
  431.     }
  432.     if #result = retrylater
  433.     {
  434.         gosub TamingIgnore temp %tameid
  435.         return
  436.     }
  437.     if #result = ignore
  438.     {
  439.         gosub TamingIgnore perm %tameid
  440.         return
  441.     }
  442.     if #result = cancel
  443.     {
  444.         menu set autotame #false
  445.         return
  446.     }
  447.     if #result = skill
  448.     {
  449.         gosub TamingIgnore skill %tameid
  450.         return
  451.     }
  452.     gosub ScriptIdletime
  453.     goto TamingLoop
  454. return
  455.  
  456. sub TamingMonitor
  457.     set %movetimer 0
  458.     set %tametimer #systime + 15000
  459.     TamingMonitorLoop:
  460.     if #jindex >= %tamejournal
  461.     {
  462.         scanjournal %tamejournal
  463.         set %tamejournal %tamejournal + 1
  464.         if start_to_tame in #journal
  465.             menu set status Taming Animal
  466.         if seems_to_accept in #journal
  467.             return success
  468.         if anger_the_beast in #journal
  469.             return retry
  470.         if fail_to_tame in #journal
  471.             return retry
  472.         if too_far in #journal
  473.             return retry
  474.         if clear_path in #journal
  475.             return retry
  476.         if too_many_followers in #journal
  477.             return cancel
  478.         if can't_see_that in #journal
  479.             return retrylater
  480.         if too_angry in #journal
  481.             return retrylater
  482.         if distracted in #journal
  483.             return retrylater
  484.         if someone_else in #journal
  485.             return retrylater
  486.         if tame_already in #journal
  487.             return ignore
  488.         if cannot_be_tamed in #journal
  489.             return ignore
  490.         if can't_tame_that in #journal
  491.             return ignore
  492.         if no_chance in #journal
  493.             return skill
  494.     }
  495.     if #followers > %tamefollow
  496.         return success
  497.     if #menubutton = ignorecurrent
  498.         return ignore
  499.     if #systime > %tametimer
  500.         return retry
  501.     finditem %tameid G_16
  502.     if #findkind = -1
  503.         return retry
  504.     if #finddist > 3 && #systime > %movetimer
  505.     {
  506.         menu get dontmove
  507.         if #menures = #false
  508.             event pathfind #findx #findy #findz
  509.         set %movetimer #systime + 1500
  510.     }
  511.     gosub ScriptIdletime
  512.     goto TamingMonitorLoop
  513. return
  514.  
  515. sub TamingRelease
  516.     menu get releasecontext
  517.     if #menures = #false
  518.     {
  519.         menu get releaserename
  520.         if #menures = #false
  521.         {
  522.             event macro 1 0 All Follow Me
  523.             return
  524.         }
  525.     }
  526.     menu set status Releasing Animal
  527.     set %attempt 0
  528.     set %adjust #false
  529.     set %tamefollow #followers
  530.     event macro 1 0 All Stay
  531.     wait 10
  532.     gosub GetAnimalDisplacement
  533.     TamingReleaseLoop:
  534.     ;if #contid = #charid
  535.     ;{
  536.     ;    event macro 8 2
  537.     ;    wait 10
  538.     ;    contpos %statusposx %statusposy
  539.     ;    wait 10
  540.     ;}
  541.     ;if #contid = %tameid
  542.     ;{
  543.         gosub TamingRename
  544.         wait 2s
  545.         event macro 1 0 JewJew Release
  546.         wait 3s
  547.     ;}
  548.     if #contname = generic_gump
  549.     {
  550.         ;if #contsize = 118_186
  551.         ;{
  552.         ;    set %xx #contposx + 50
  553.         ;    set %yy #contposy + 165
  554.         ;    click %xx %yy F
  555.         ;    wait 1s
  556.         ;}
  557.         if #contsize = 270_120
  558.         {
  559.             set %xx #contposx + 30
  560.             set %yy #contposy + 90
  561.             click %xx %yy
  562.             wait 1s
  563.         }
  564.  
  565.         ;else
  566.         ;{
  567.         ;    set %xx #contposx + 50
  568.         ;    set %yy #contposy + 10
  569.         ;    click %xx %yy R
  570.         ;    wait 15
  571.         ;}
  572.     }
  573.     if #followers < %tamefollow
  574.     {
  575.         menu get releasekill
  576.         if #followers < 1
  577.    {
  578.        menu get releasekill
  579.        if #menures = #true
  580.            gosub TamingKill
  581.        return
  582.    }
  583. ;   else
  584.  ;  {
  585. ;   goto TamingReleaseLoop
  586.  ;  }
  587.  
  588.     set %attempt ( %attempt % 5 ) + 1
  589.     finditem %tameid
  590.     if #findkind = -1
  591.         return
  592.     if %attempt > 1 && #finddist > 3
  593.     {
  594.         event macro 1 0 All Stay
  595.         event pathfind #findx #findy #findz
  596.         wait 2s
  597.         set %attempt 0
  598.         goto TamingReleaseLoop
  599.     }
  600.     if #finddist = 0
  601.         set %adjust #true
  602.     if #finddist = 1
  603.     {
  604.         set %deltax #findx - #charposx
  605.         set %deltay #findy - #charposy
  606.         if %deltay < 0 && %deltax = 0
  607.             set %adjust #true
  608.         if %deltay < 0 && %deltax < 0
  609.             set %adjust #true
  610.         if %deltay = 0 && %deltax < 0
  611.             set %adjust #true
  612.     }
  613.     if %adjust = #true
  614.     {
  615.         if %attempt = 1
  616.         {
  617.             event macro 5 7 ; walk west
  618.             event macro 5 7 ; walk west
  619.             wait 1s
  620.         }
  621.         if %attempt = 2
  622.         {
  623.             event macro 5 2 ; walk north east
  624.             event macro 5 2 ; walk north east
  625.             event macro 5 2 ; walk north east
  626.             wait 1s
  627.         }
  628.         if %attempt = 3
  629.         {
  630.             event macro 5 6 ; walk south west
  631.             event macro 5 6 ; walk south west
  632.             event macro 5 6 ; walk south west
  633.             wait 1s
  634.         }
  635.         if %attempt = 4
  636.         {
  637.             event macro 5 1 ; walk north
  638.             event macro 5 1 ; walk north
  639.             event macro 5 1 ; walk north
  640.             wait 1s
  641.         }
  642.         if %attempt = 5
  643.         {
  644.             event macro 5 4 ; walk south east
  645.             event macro 5 4 ; walk south east
  646.             event macro 5 4 ; walk south east
  647.             event macro 5 4 ; walk south east
  648.             wait 1s
  649.         }
  650.         set %adjust #false
  651.         goto TamingReleaseLoop
  652.     }
  653.     finditem %tameid
  654.     if #findkind = -1
  655.         return
  656.     gosub GetScreenXY #findx #findy #findz 0 %screenydisp
  657.     menu get releasecontext
  658.     if #menures = #true
  659.     {
  660.         click %screenx %screeny F
  661.         wait 1s
  662.         goto TamingReleaseLoop
  663.     }
  664.     menu get releaserename
  665.     if #menures = #true
  666.     {
  667.         ;click %screenx %screeny L
  668.         ;wait 1s
  669.         ;click %screenx  %screeny P
  670.         ;wait 1s
  671.         ;goto TamingReleaseLoop
  672.     }
  673.     event macro 1 0 All Follow Me
  674. return
  675.  
  676. sub TamingRename
  677.     exevent RenamePet #LTARGETID JewJew
  678.     wait 1s
  679. return
  680.  
  681.  
  682.  
  683. sub TamingRenameZZZ
  684.     menu set status Ranaming Animal
  685.     contpos 5 30
  686.     wait 5
  687.     set %screenx #contposx + 130
  688.     set %screeny #contposy + 20
  689.     click %screenx %screeny
  690.     for %i 1 5
  691.     {
  692.         key RIGHT
  693.     }
  694.     for %i 1 20
  695.     {
  696.         key BACK
  697.     }
  698.     msg JewJew$
  699.     wait 1s
  700.     click %screenx %screeny r
  701.     wait 2s
  702. return
  703.  
  704. sub TamingKill
  705.     menu set status Killing Animal
  706.     TamingKillLoop:
  707.     finditem %tameid
  708.     if #findkind = -1
  709.         return
  710.     if #mana < 50
  711.     {
  712.         chooseskill medi
  713.         if #skill > 500
  714.         {
  715.             event macro 13 46 ; meditation
  716.             wait 11s
  717.             goto TamingKillLoop
  718.         }
  719.         else
  720.         {
  721.             event sysmessage You must have at least 50 skill Meditation to use this option.
  722.             menu set releasekill #false
  723.             return
  724.         }
  725.     }
  726.     set #ltargetid %tameid
  727.     set #ltargetkind 1
  728.     chooseskill eval
  729.     if #skill >= 800
  730.         event macro 15 54 ; flame strike
  731.     else
  732.     {
  733.         chooseskill necr
  734.         if #skill >= 800
  735.             event macro 15 109 ; pain strike
  736.         else
  737.         {
  738.             event sysmessage You must have at least 80 skill in Necromancy or Evaluating Intelligence to use this option.
  739.             menu set releasekill #false
  740.             return
  741.         }
  742.     }
  743.     target 6s
  744.     event macro 22 0 ; last target
  745.     wait 2s
  746.     goto TamingKillLoop
  747.  
  748.  
  749.  
  750. return
  751.  
  752. ; clickScreenXYZ by ScriptFellow modded by Roadkill
  753. ; Mods by UncleDave
  754. sub GetScreenXY
  755.     set %1 ( %1 - #charposx ) * 22  ; world x-coordinate
  756.     set %2 ( #charposy - %2 ) * 22  ; world y-coordinate
  757.     set %3 ( %3 - #charposz ) * 4   ; world z-coordinate
  758.     if %0 < 4 || %4 = N/A
  759.         set %4 0                    ; x displacement, added to screen coordinate
  760.     if %0 < 5 || %5 = N/A
  761.         set %5 35                   ; y displacement, added to screen coordinate
  762.     set %screenx #clileft + #clixres / 2 + %1 + %2 + %4
  763.     set %screeny #clitop + #cliyres / 2 + %1 - %2 - %3 + %5
  764.     set %offscreen #true
  765.     if %screenx > #clileft &&
  766.         + %screeny > #clitop &&
  767.         + %screenx < ( #clileft + #clixres ) &&
  768.         + %screeny < ( #clitop + #cliyres )
  769.     {
  770.         set %offscreen #false
  771.         ;click %screenx %screeny F
  772.     }
  773. return
  774.  
  775. ; GetYDisplacementForAnimType by Roadkill
  776. ; Mods by UncleDave
  777. sub GetAnimalDisplacement
  778.     set %screenydisp -32
  779.     if %tametype in GE_ZD_L_M_TF__IG_NG__ZF_PF_EG_CO_TG_PG_VD
  780.         set %screenydisp -25
  781.     if %tametype in AH
  782.         set %screenydisp -45
  783.     if %tametype in DG_AG_WC_RF_WG_TC
  784.         set %screenydisp -15
  785. return
  786.  
  787. sub SetReagentContainer
  788.     if %tameid <> N/A
  789.     {
  790.         event sysmessage You must wait until you are finished taming.
  791.         return
  792.     }
  793.     event sysmessage Target the container to drop reagents.
  794.     gosub GetTargetId
  795.     set %regcont #ltargetid
  796. return
  797.  
  798. sub PickupRegs
  799.     finditem %1 G_16
  800.     if #findkind = -1
  801.         return
  802.     menu set status Picking Up Reagents
  803.     set %regsid #findid
  804.     set %regsdist #finddist
  805.     if %regsdist > 2
  806.     {
  807.         gosub PathfindWait #findx #findy #findz
  808.         if %moveres = error
  809.         {
  810.             ignoreitem %regsid
  811.             return
  812.         }
  813.     }
  814.     gosub GetContainerPos %regcont
  815.     if #result = #false
  816.     {
  817.         event sysmessage Unable to find reagent container.
  818.         menu set pickupregs #false
  819.         return
  820.     }
  821.     set %js #jindex
  822.     event drag %regsid
  823.     wait 10
  824.     if #contname = stack_gump
  825.         key ENTER
  826.     set %je #jindex
  827.     for %ji %js %je
  828.     {
  829.         scanjournal %ji
  830.         if can_not_pick in #journal 2
  831.             ignoreitem %regsid
  832.             return
  833.     }
  834.     click %contdropx %contdropy
  835.     wait 10
  836. return
  837.  
  838. sub PickupRegsNearby
  839.     menu get pickupregs
  840.     if #menures = #false
  841.         return
  842.     finditem %reagents G_2
  843.     if #findkind <> -1
  844.         gosub PickupRegs #findid
  845. return
  846.  
  847. sub FindClosestItem
  848.     finditem %1 G_16
  849.     set %findid #findid
  850.     set %findtype #findtype
  851.     set %finddist #finddist
  852.     if #findcnt > 1
  853.     {
  854.         for %i 1 #findcnt
  855.         {
  856.             finditem %1 %i G_16
  857.             if #findkind <> -1 && #finddist < %finddist
  858.             {
  859.                 set %findid #findid
  860.                 set %findtype #findtype
  861.                 set %finddist #finddist
  862.             }
  863.         }
  864.     }
  865. return
  866.  
  867. sub GetTargetId
  868.     set #ltargetid N/A
  869.     set #targcurs 1
  870.     GetTargetIdLoop:
  871.     if #targcurs = 1
  872.         goto GetTargetIdLoop
  873. return
  874.  
  875. sub PathfindWait
  876.     set %moveres unknown
  877.     menu get dontmove
  878.     if #menures = #true
  879.         return
  880.     if #charposx = %1 && #charposy = %2
  881.     {
  882.         set %moveres success
  883.         return
  884.     }
  885.     set %js #jindex
  886.     event pathfind %1 %2 %3
  887.     wait 10
  888.     set %je #jindex
  889.     for %ji %js %je
  890.     {
  891.         scanjournal %ji
  892.         if pathfinding in #journal
  893.         {
  894.             set %movex #charposx
  895.             set %movey #charposy
  896.             set %movetimer #systime + 500
  897.             PathfindWaitLoop:
  898.             if #systime < %movetimer
  899.                 goto PathfindWaitLoop
  900.             if %movex = %1 && %movey = %2
  901.             {
  902.                 set %moveres success
  903.                 return
  904.             }
  905.             if %movex = #charposx && %movey = #charposy
  906.             {
  907.                 set %moveres stopped
  908.                 return
  909.             }
  910.             set %movex #charposx
  911.             set %movey #charposy
  912.             set %movetimer #systime + 500
  913.             goto PathfindWaitLoop
  914.         }
  915.         if can't_get_there in #journal
  916.         {
  917.             set %moveres error
  918.             return
  919.         }
  920.     }
  921. return
  922.  
  923. sub GetContainerPos
  924.     finditem %1 C
  925.     if #findkind = -1
  926.         return #false
  927.     if #findtype = ZJF 5 ; backpack
  928.         set %contposx #findx + 22
  929.         set %contposy #findy + 16
  930.         set %contdropx #findx + 22
  931.         set %contdropy #findy + 12
  932.         return #true
  933.     if #findtype = CKF 5 ; bag
  934.         set %contposx #findx + 22
  935.         set %contposy #findy + 15
  936.         set %contdropx #findx + 21
  937.         set %contdropy #findy + 10
  938.         return #true
  939.     if #findtype = LKF 5 ; pouch
  940.         set %contposx #findx + 22
  941.         set %contposy #findy + 13
  942.         set %contdropx #findx + 25
  943.         set %contdropy #findy + 7
  944.         return #true
  945. return #false
  946.  
  947.  
  948.  
  949.  
  950.