XenoBot Forums - Powered by vBulletin

User Tag List

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: how to add monster count to this script?

  1. #11
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Fixed and tested.
    lua code:

    local Spells = {
    {words = 'exori flam', hppc = 0, range = 3, mana = 20, count = 3, list = {'rat', 'cave rat', 'bat', 'corym charlatan'}
    }
    }

    local PvPRadiusSafety = 3
    local MonsterRange = 8

    function SafeRadius(radius)
    for n, c in Creature.iPlayers() do
    if c:DistanceFromSelf() < radius then
    return true
    end
    end
    end

    function MonstersAround(list, radius)
    local k = 0
    for name, creature in Creature.iMonsters({distancefromself = {lt, radius}}) do
    if (list ~= nil) then
    if table.contains(list, name:lower()) then
    k = k + 1
    end
    else
    k = k + 1
    end
    end
    return k
    end

    BattleMessageProxy.OnReceive('shooter', function(proxy, message)
    local givendmg = string.match(message, "(.+) due to your attack.")
    if (givendmg) then
    local id = Self.TargetID()
    if (id ~= 0) then
    local mp = Self.Mana()
    local c = Creature.New(id)
    for i = 1, #Spells do
    if table.contains(Spells[i].list, c:Name():lower()) then
    if MonstersAround(Spells[i].list, MonsterRange) >= Spells[i].count then
    if Self.CanCastSpell(Spells[i].words) and mp > Spells[i].mana and c:HealthPercent() >= Spells[i].hppc then
    local isUnsafe = SafeRadius(PvPRadiusSafety)
    if not (isUnsafe) and c:DistanceFromSelf() <= Spells[i].range then
    if c:isTarget() then
    Self.Cast(Spells[i].words, Spells[i].mana)
    end
    end
    break
    end
    end
    end
    end
    end
    end
    end)
    Last edited by grave18; 12-29-2015 at 12:14 AM.

  2. #12

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by grave18 View Post
    Fixed and tested.
    lua code:

    local Spells = {
    {words = 'exori flam', hppc = 0, range = 3, mana = 20, count = 3, list = {'rat', 'cave rat', 'bat', 'corym charlatan'}
    }
    }

    local PvPRadiusSafety = 3
    local MonsterRange = 8

    function SafeRadius(radius)
    for n, c in Creature.iPlayers() do
    if c:DistanceFromSelf() < radius then
    return true
    end
    end
    end

    function MonstersAround(list, radius)
    local k = 0
    for name, creature in Creature.iMonsters({distancefromself = {lt, radius}}) do
    if (list ~= nil) then
    if table.contains(list, name:lower()) then
    k = k + 1
    end
    else
    k = k + 1
    end
    end
    return k
    end

    BattleMessageProxy.OnReceive('shooter', function(proxy, message)
    local givendmg = string.match(message, "(.+) due to your attack.")
    if (givendmg) then
    local id = Self.TargetID()
    if (id ~= 0) then
    local mp = Self.Mana()
    local c = Creature.New(id)
    for i = 1, #Spells do
    if table.contains(Spells[i].list, c:Name():lower()) then
    if MonstersAround(Spells[i].list, MonsterRange) >= Spells[i].count then
    if Self.CanCastSpell(Spells[i].words) and mp > Spells[i].mana and c:HealthPercent() >= Spells[i].hppc then
    local isUnsafe = SafeRadius(PvPRadiusSafety)
    if not (isUnsafe) and c:DistanceFromSelf() <= Spells[i].range then
    if c:isTarget() then
    Self.Cast(Spells[i].words, Spells[i].mana)
    end
    end
    break
    end
    end
    end
    end
    end
    end
    end)
    I will try it, thank you so much for your help you don't understand how much I appreciate it !!!

  3. #13

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    it worked now thank you SOOOOOOOOOOOOO much from bottom of my heart =)
    Last edited by jollebollen; 01-22-2016 at 02:31 AM.

  4. #14
    Moderator Elvang's Avatar
    Join Date
    Dec 2010
    Location
    B.C. Canada
    Posts
    1,365
    Mentioned
    104 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by jollebollen View Post
    it worked now thank you SOOOOOOOOOOOOO much from bottom of my heart =)
    Xenobot has been updated to prevent skulling with strike spells.

  5. #15

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Elvang View Post
    Xenobot has been updated to prevent skulling with strike spells.
    yeah i know, but try it yourself, sd a monster and side step infront of someone and they will hit you, you have to time it really good..

Posting Permissions

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