Advertisement
Xeyseir

Untitled

Apr 25th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.08 KB | None | 0 0
  1. DW_CHECK:
  2. if matchre("$WeaponType", "(THE|THB|BOW|SLINGS)") then return
  3. if ("$guild") = "Barbarian" then goto DW_BARB
  4. if (%DW.Time < 200) then return
  5. if (%DW.Time > 200) then goto DW_SWITCH
  6. return
  7.  
  8. DW_SWITCH:
  9. echo
  10. echo **** SWITCHING DUAL WIELD WEAPON
  11. echo
  12. gosub stow %CurrentDW
  13. pause 0.2
  14. if ("%CurrentDW" = "%DW.Weapon1") && (toupper("%DW.Weapon2") != "NULL") && !matchre("%WEAPON", "%DW.Weapon2") then goto DW2
  15. if ("%CurrentDW" = "%DW.Weapon1") && (toupper("%DW.Weapon3") != "NULL") && !matchre("%WEAPON", "%DW.Weapon3") then goto DW3
  16. if ("%CurrentDW" = "%DW.Weapon2") && (toupper("%DW.Weapon3") != "NULL") && !matchre("%WEAPON", "%DW.Weapon3") then goto DW3
  17. if ("%CurrentDW" = "%DW.Weapon2") && (toupper("%DW.Weapon1") != "NULL") && !matchre("%WEAPON", "%DW.Weapon1") then goto DW1
  18. if ("%CurrentDW" = "%DW.Weapon3") && (toupper("%DW.Weapon1") != "NULL") && !matchre("%WEAPON", "%DW.Weapon1") then goto DW1
  19. if ("%CurrentDW" = "%DW.Weapon3") && (toupper("%DW.Weapon2") != "NULL") && !matchre("%WEAPON", "%DW.Weapon2") then goto DW2
  20. return
  21. DW1:
  22. pause 0.2
  23. gosub GET %DW.Weapon1
  24. var CurrentDW %DW.Weapon1
  25. pause 0.3
  26. return
  27. DW2:
  28. pause 0.2
  29. gosub GET %DW.Weapon2
  30. var CurrentDW %DW.Weapon2
  31. pause 0.3
  32. return
  33. DW3:
  34. pause 0.2
  35. gosub GET %DW.Weapon3
  36. var CurrentDW %DW.Weapon3
  37. pause 0.3
  38. return
  39.  
  40.  
  41. DW_BARB:
  42. debug 5
  43. var DW_county 0
  44. if ("%SEWEAPON" != "NULL") then math DW_county add 1
  45. if ("%LEWEAPON" != "NULL") then math DW_county add 1
  46. if ("%SBWEAPON" != "NULL") then math DW_county add 1
  47. if ("%STAVES" != "NULL") then math DW_county add 1
  48. if ("%LBWEAPON" != "NULL") then math DW_county add 1
  49. if ("%POLEARMS" != "NULL") then math DW_county add 1
  50. var DW_counted %DW_county
  51.  
  52. var DW_county 0
  53. if ("%SEWEAPON" != "NULL") then math DW_county add $Small_Edged.LearningRate
  54. if ("%LEWEAPON" != "NULL") then math DW_county add $Large_Edged.LearningRate
  55. if ("%SBWEAPON" != "NULL") then math DW_county add $Small_Blunt.LearningRate
  56. if ("%LBWEAPON" != "NULL") then math DW_county add $Large_Blunt.LearningRate
  57. if ("%STAVES" != "NULL") then math DW_county add $Staves.LearningRate
  58. if ("%POLEARMS" != "NULL") then math DW_county add $Polearms.LearningRate
  59. evalmath DW_weapon_avg %DW_county / %DW_counted
  60.  
  61. if ("%WEAPON" != "%SEWEAPON") then var DW_weapon_skill Small_Edged
  62. if ("%WEAPON" = "%SEWEAPON") then var DW_weapon_skill Small_Blunt
  63. if ("%SEWEAPON" != "NULL") && ("%SEWEAPON" != "%WEAPON") && ($Small_Edged.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Small_Edged
  64. if ("%LEWEAPON" != "NULL") && ("%LEWEAPON" != "%WEAPON") && ($Large_Edged.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Large_Edged
  65. if ("%SBWEAPON" != "NULL") && ("%SBWEAPON" != "%WEAPON") && ($Small_Blunt.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Small_Blunt
  66. if ("%LBWEAPON" != "NULL") && ("%LBWEAPON" != "%WEAPON") && ($Large_Blunt.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Large_Blunt
  67. if ("%STAVES" != "NULL") && ("%STAVES" != "%WEAPON") && ($Staves.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Staves
  68. if ("%POLEARMS" != "NULL") && ("%POLEARMS" != "%WEAPON") && ($Polearms.LearningRate <= %DW_weapon_avg) then var DW_weapon_skill Polearms
  69.  
  70. if ("%DW_weapon_skill" = "Small_Edged") then var DW_preselect %SEWEAPON
  71. if ("%DW_weapon_skill" = "Large_Edged") then var DW_preselect %LEWEAPON
  72. if ("%DW_weapon_skill" = "Small_Blunt") then var DW_preselect %SBWEAPON
  73. if ("%DW_weapon_skill" = "Large_Blunt") then var DW_preselect %LBWEAPON
  74. if ("%DW_weapon_skill" = "Staves") then var DW_preselect %STAVES
  75. if ("%DW_weapon_skill" = "Polearms") then var DW_preselect %POLEARMS
  76.  
  77. var DW.Barb_final_check 0
  78. DW.Barb_final_checks:
  79. evalmath DW.Barb_final_check add 1
  80.  
  81. if ("%SEWEAPON" != "NULL") && ("%SEWEAPON" != "%WEAPON") && ($Small_Edged.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Small_Edged
  82. if ("%LEWEAPON" != "NULL") && ("%LEWEAPON" != "%WEAPON") && ($Large_Edged.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Large_Edged
  83. if ("%SBWEAPON" != "NULL") && ("%SBWEAPON" != "%WEAPON") && ($Small_Blunt.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Small_Blunt
  84. if ("%LBWEAPON" != "NULL") && ("%LBWEAPON" != "%WEAPON") && ($Large_Blunt.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Large_Blunt
  85. if ("%STAVES" != "NULL") && ("%STAVES" != "%WEAPON") && ($Staves.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Staves
  86. if ("%POLEARMS" != "NULL") && ("%POLEARMS" != "%WEAPON") && ($Polearms.LearningRate <= $%DW_weapon_skill.LearningRate) then var DW_weapon_skill Polearms
  87.  
  88. if ("%DW_weapon_skill" = "Small_Edged") then var DW_preselect %SEWEAPON
  89. if ("%DW_weapon_skill" = "Large_Edged") then var DW_preselect %LEWEAPON
  90. if ("%DW_weapon_skill" = "Small_Blunt") then var DW_preselect %SBWEAPON
  91. if ("%DW_weapon_skill" = "Large_Blunt") then var DW_preselect %LBWEAPON
  92. if ("%DW_weapon_skill" = "Staves") then var DW_preselect %STAVES
  93. if ("%DW_weapon_skill" = "Polearms") then var DW_preselect %POLEARMS
  94.  
  95. if (%DW.Barb_final_check < 2) then goto DW.Barb_final_checks
  96.  
  97. if ("%CurrentDW" != "%DW_preselect") && ("$lefthand" != "Empty") then gosub stow %CurrentDW
  98. if ("%CurrentDW" != "%DW_preselect") then gosub GET %DW_preselect
  99. if ("%CurrentDW" != "%DW_preselect") then if matchre(tolower("%DW_preselect") , "$ALLSWAPPABLE") || matchre("$lefthand", "$ALLSWAPPABLE") then gosub DW.SWAPPABLE
  100. var CurrentDW %DW_preselect
  101. debug 0
  102. return
  103.  
  104. DW.SWAPPABLE:
  105. delay 0.0001
  106. DW.SWAPPABLE_1:
  107. var LOCATION DW.SWAPPABLE_1
  108. if (!$standing) then gosub STAND
  109. matchre WAIT ^\.\.\.wait|^Sorry\,|^Please wait\.|you don't feel like fighting
  110. matchre STUNNED ^You are still stunned
  111. matchre WEBBED ^You can't do that while entangled in a web
  112. matchre IMMOBILE ^You don't seem to be able to move to do that
  113. matchre RETURN ^You turn your|^You must have two free hands to use
  114. put swap my $lefthandnoun
  115. matchwait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement