StonVirie - 2009-10-24 22:40:38

Czar polega na tym, że mówimy inkatację i do każdego gracza albo potwora na ekranie wylatuje od nas strzała. Manę zabiera na początku oraz przy każdym wystrzeleniu strzały. Czar pomaga przy ucieczce przed dużą grupą PK, albo przy zabijaniu dużej ilości słabych potworów. Jest przeznaczony dla palladyna i sorka.
Tak jak i poprzedni skrypt nie jest mój ale jest lekko przeze mnie przerobiony.
Tworzymy plik o nazwie arrow wave.lua w folderze data/spells/scripts, a następnie wklejamy do niego:

-- Massive Arrow Wave by Ston Virie
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.5, 0, 0.7, 20)
local obszar = {
poziomo = 7
pionowo = 5 
}
local manaPerTarget = 100
function onCastSpell(cid, var)
local specs = getSpectators(getCreaturePosition(cid), obszar.poziomo, obszar.pionowo, FALSE)
for i=1, #specs do
    if((getCreatureMana(cid) > manaPerTarget or isPlayer(cid) == FALSE) and isNpc(specs[i]) == FALSE and getTilePzInfo(getCreaturePosition(specs[i])) == FALSE) then
        local target = specs[i]
        if(target ~= cid) then
            local targetPos = getCreaturePosition(target)
            if(isSightClear == nil or isSightClear(getCreaturePosition(cid), targetPos, FALSE) == TRUE) then
                doCombat(cid, combat, numberToVariant(target))
                if(isPlayer(cid) == TRUE) then
                    doCreatureAddMana(cid, -manaPerTarget)
                    doPlayerAddSpentMana(cid, manaPerTarget)
                end
            end
        end
    else
        break
    end
end
if(#specs == 1) then
    doPlayerSendCancel(cid,"You do not have any target.")
end
return TRUE
end

Teraz gdy skrypt już zrobiony otwieramy spells.xml, które znajduje się w folderze data/spells i dodajemy do niego:

<instant name="Massive Arrow Strike" words="exevo mas con" lvl="50" mana="180" prem="1" blockwalls="1" exhaustion="2000" needlearn="1" script="arrow wave.lua">
        <vocation name="Paladin" />
        <vocation name="Royal Paladin" />
        <vocation name="Sorcerer" />
        <vocation name="Master Sorcerer" />
    </instant>

źródło: tibia.net.pl

GotLink.pl