XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 10 of 11

Thread: [REQUEST] If ghost on screen change weapon (for ek)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    This will switch to a Fire Sword if you're targeting a Ghost and then switch back again whenever you're not targeting a Ghost.

    lua code:

    local specialMonsters = {"Ghost"}
    local defaultWeapon = "Mystic Blade"
    local specialWeapon = "Fire Sword"

    -----------------------------------------------
    -----------------------------------------------
    -----------------------------------------------

    defaultWeapon = Item.GetID(defaultWeapon)
    specialWeapon = Item.GetID(specialWeapon)

    Module("Weapon changer", function(self)
    local c = Creature(Self.TargetID())
    local useSpecial = c and table.find(specialMonsters, c:Name())
    if useSpecial and Self.Weapon().id ~= specialWeapon then
    Self.Equip(specialWeapon, "weapon")
    self:Delay(5000)
    elseif not useSpecial and Self.Weapon().id ~= defaultWeapon then
    Self.Equip(defaultWeapon, "weapon")
    self:Delay(5000)
    end
    end)
    Last edited by shadowart; 12-07-2015 at 02:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •