Signup Now
Results 1 to 3 of 3
  1. #1
    Free User
    Join Date
    Dec 2015
    Posts
    70
    Reputation
    10
    Rep Power
    17

    bug in bestelement() function. Check It

    i found bug in bestelement() function.
    There is: creaturename.physical

    and it returns nill cuz should be

    creaturename.physicalmod

    and please add to this func

    elseif $voc == 4 then
    elements.holy = creaturename.holymod
    elseif $voc == 2 then
    elements.physical = creaturename.physicalmod
    end

    cuz paladin and kinght got exori spells too.


    http://paste.ofcode.org/hhv4xwJ4znPhdYpFTiY6eT
    Last edited by klabaternik; 01-24-2016 at 11:33 AM.

  2. #2
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    @Lucas Terra

    PS: Can't open the link.

  3. #3
    Free User
    Join Date
    Dec 2015
    Posts
    70
    Reputation
    10
    Rep Power
    17
    @Lucas Terra
    @Raphael

    i added knight, paladin strike spells:
    normal:
    Ethereal Spear (p)
    Divine Missile (p) holymod
    Whirlwind Throw (k)
    strong:
    Strong Ethereal Spear (p)
    Brutal Strike (k)

    changelog:
    getbestspell
    - (normal) it returns divine missile for holymod (paladin) and ethereal spear, whirlwind throw for physicalmod (knight, paladin)
    - (strong) it returns strong ethereal spear and brutal strike for physicalmod (knight, paladin)
    bestelement
    - it returns physical, holy (paladin) and physical (knight)
    caststrongstrike
    - cast exori ico (knight) exori gran con (paladin)

    function _getbestspell(name, type)
    local strongonly = (type == 'strong strike')
    local result = bestelement(name, strongonly)

    if (result == '') then
    return spellinfo('flame strike')
    elseif (strongonly) then
    if (result == 'fire') then
    return spellinfo('strong flame strike')
    elseif (result == 'ice') then
    return spellinfo('strong ice strike')
    elseif (result == 'earth') then
    return spellinfo('strong terra strike')
    elseif (result == 'energy') then
    return spellinfo('strong energy strike')
    elseif (result == 'physical') then
    if $voc == 4 then --paladin
    return spellinfo('strong ethereal spear')
    else --if $voc == 2 then --knight
    return spellinfo('brutal strike')
    end
    end
    else
    if (result == 'fire') then
    return spellinfo('flame strike')
    elseif (result == 'ice') then
    return spellinfo('ice strike')
    elseif (result == 'earth') then
    return spellinfo('terra strike')
    elseif (result == 'energy') then
    return spellinfo('energy strike')
    elseif (result == 'death') then
    return spellinfo('death strike')
    elseif (result == 'holy') then --holy
    return spellinfo('divine missile')
    elseif (result == 'physical') then
    if $voc == 4 then --paladin
    return spellinfo('ethereal spear')
    elseif $voc == 2 then -- knight
    return spellinfo('whirlwind throw')
    else --sorcerer,druid
    return spellinfo('physical strike')
    end
    end
    end
    end


    function _bestelement(creaturename, strongonly)
    creaturename = creatureinfo(creaturename)
    local elements = {}
    if strongonly then
    if $voc == 16 then -- druid
    elements.ice = creaturename.icemod
    elements.earth = creaturename.earthmod
    elseif $voc == 8 then -- sorcerer
    elements.fire = creaturename.firemod
    elements.energy = creaturename.energymod
    elseif $voc == 4 or $voc == 2 then -- paladin, knight
    elements.physical = creaturename.physicalmod
    end
    else
    if $voc == 16 or $voc == 8 then
    elements = {fire = creaturename.firemod, ice = creaturename.icemod, earth = creaturename.earthmod, energy = creaturename.energymod}
    if $voc == 16 then -- druid
    elements.physical = creaturename.physicalmod
    elseif $voc == 8 then -- sorcerer
    elements.death = creaturename.deathmod
    end
    else
    elements = {}
    if $voc == 4 then -- paladin
    elements.physical = creaturename.physicalmod
    elements.holy = creaturename.holymod
    elseif $voc == 2 then -- knight
    elements.physical = creaturename.physicalmod
    end
    end
    end

    local bestele, bestmod = '', 0
    for ele,mod in pairs(elements) do
    if mod > bestmod then
    bestmod = mod
    bestele = ele
    end
    end

    return bestele
    end


    function _caststrongstrike(a,b,c)
    if $attacked.id > 0 then
    a,b,c = a or 900, b or 1100, c or 75
    local voc = vocation()
    local spell
    local mana = 60
    if voc == 'druid' then
    if $attacked.ismonster then
    local temp = creatureinfo($attacked.name)
    if cooleddown('strong ice strike') and (temp.icemod >= temp.earthmod or not cooleddown('strong terra strike')) and (temp.icemod >= c) then
    spell = 'exori gran frigo'
    elseif cooleddown('strong terra strike') and (temp.earthmod >= temp.icemod or not cooleddown('strong ice strike')) and (temp.earthmod >= c) then
    spell = 'exori gran tera'
    end
    else
    if cooleddown('strong ice strike') then
    spell = 'exori gran frigo'
    elseif cooleddown('strong terra strike') then
    spell = 'exori gran tera'
    end
    end
    elseif voc == 'sorcerer' then
    if $attacked.ismonster then
    local temp = creatureinfo($attacked.name)
    if cooleddown('strong energy strike') and (temp.energymod >= temp.firemod or not cooleddown('strong flame strike')) and (temp.energymod >= c) then
    spell = 'exori gran vis'
    elseif cooleddown('strong flame strike') and (temp.firemod >= temp.energymod or not cooleddown('strong energy strike')) and (temp.firemod >= c) then
    spell = 'exori gran flam'
    end
    else
    if cooleddown('strong energy strike') then
    spell = 'exori gran vis'
    elseif cooleddown('strong flame strike') then
    spell = 'exori gran flam'
    end
    end
    elseif voc == 'paladin' then
    if $attacked.ismonster then
    local temp = creatureinfo($attacked.name)
    if not cooleddown('exori gran con') and (temp.physicalmod >= c) then
    spell = 'exori gran con'
    end
    else
    if cooleddown('exori gran con') then
    spell = 'exori gran con'
    end
    end
    elseif voc == 'knight' then
    if $attacked.ismonster then
    local temp = creatureinfo($attacked.name)
    if not cooleddown('exori ico') and (temp.physicalmod >= c) then
    spell = 'exori ico'
    mana = 30
    end
    else
    if cooleddown('exori ico') then
    spell = 'exori ico'
    mana = 30
    end
    end
    end
    if spell and cooleddown(spell) and $mp >= mana and $attacked.hppc > 0 and $attacked.dist <= 3 and $attacked.isshootable then
    cast(spell)
    wait(a,b)
    return true
    end
    end
    return false
    end
    Last edited by klabaternik; 02-17-2016 at 12:30 AM.

 

 

Posting Permissions

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