daily pastebin goal
71%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. weapon = "axe of mayhem"
  2. helmet = "zaoan helmet"
  3. armor = "ornate chestplate"
  4. shield = "ornate shield"
  5.  
  6. useshield = true
  7.  
  8. --------------------------
  9. weaponid = 23225 --Item.GetID(weapon) or 23225
  10. helmetid = Item.GetID(helmet)
  11. armorid = Item.GetID(armor)
  12. shieldid = Item.GetID(shield)
  13.  
  14. function GetCreatureCount()
  15.     count = 0
  16.     for _, c in Creature.iMonsters(7) do
  17.         if Self.DistanceFromPosition(c:Position().x, c:Position().y, c:Position().z) < 4 then
  18.             count = count + 1
  19.         end
  20.     end
  21.     return count
  22. end
  23.  
  24.  
  25. Module.New('sd', function(module)
  26.     if GetCreatureCount() >= 1 then
  27.         change = true
  28.     else
  29.         change = false
  30.     end
  31. end)
  32.  
  33. Module.New('aa', function(module)
  34.     if change then
  35.         if Self.Weapon().id ~= weaponid then
  36.             Self.Equip(weaponid, "weapon")
  37.         elseif Self.Head().id ~= helmetid then
  38.             Self.Equip(helmetid, "head")
  39.         elseif Self.Armor().id ~= armorid then
  40.             Self.Equip(armorid, "armor")
  41.         elseif Self.Shield().id ~= shieldid and useshield then
  42.             Self.Equip(shieldid, "shield")
  43.         end
  44.     end
  45.     if not change then
  46.         if Self.Weapon().id ~= 0 then
  47.             Self.Dequip("weapon")
  48.         elseif Self.Head().id ~= 0 then
  49.             Self.Dequip("head")
  50.         elseif Self.Armor().id ~= 0 then
  51.             Self.Dequip("armor")
  52.         elseif Self.Shield().id ~= 0 and useshield then
  53.             Self.Dequip("shield")
  54.         end
  55.     end
  56. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top