• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Co dodac w tym skrypcie zeby...

Status
Not open for further replies.

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
Co muszę dodać w tym skrypcie, żeby ta broń nie atakowała graczy w strefie PZ? :)


LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 0)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 0)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -3.0, -500, -2.6, 400)

local manaNeededPerTarget = 500
local hitExtraTargets = 3
local hitExtraTargetsInRange = 2

function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers)
    local creaturesList = {}
    for x = -radiusx, radiusx do
        for y = -radiusy, radiusy do
            if not (x == 0 and y == 0) then
                creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE})
                if (creature.type == 1 and showPlayers == 1) or (creature.type == 2 and showMonsters == 1) then
                    table.insert(creaturesList, creature.uid)
                end
            end
        end
    end
    return creaturesList
end

function onUseWeapon(cid, var)
    local ret = doCombat(cid, combat, var)
    if(ret == LUA_ERROR) then
        return LUA_ERROR
    end
    doPlayerAddManaSpent(cid, manaNeededPerTarget)
    doPlayerAddMana(cid, -manaNeededPerTarget)
   
    local target = variantToNumber(var)
    local hitplayers = 0
    if(target ~= 0) then
        if(isPlayer(target) == TRUE) then
            hitplayers = 1
        end
        local nowHit = 0
        local randomId = 0
        local otherTargets = getCreaturesInRange(getCreaturePosition(target), hitExtraTargetsInRange, hitExtraTargetsInRange, 1, hitplayers)
        if(#otherTargets > 0) then
            for i = 1, hitExtraTargets do
                if(getPlayerMana(cid) > manaNeededPerTarget) then
                    randomId = math.random(1, #otherTargets)
                    nowHit = otherTargets[randomId]
                    if(isCreature(nowHit) == TRUE) then
                        table.remove(otherTargets, randomId)
                        ret = doCombat(cid, combat, numberToVariant(nowHit))
                        if(ret ~= LUA_ERROR) then
                            doPlayerAddManaSpent(cid, manaNeededPerTarget)
                            doPlayerAddMana(cid, -manaNeededPerTarget)
                        end
                    end
                    if(#otherTargets == 0) then
                        break
                    end
                else
                    break
                end
            end
        end
    end
    return TRUE
end


#edit for Miodek.
 
Last edited:
nie, rus ;]


Proszę o pomoc co do skryptu!
 
nie, rus ;]


Proszę o pomoc co do skryptu!

Pomoc = zrobiłem coś, ale kurcze, nie działa.

To, co chcesz Ty = zróbcie za mnie, a ja wrzucę SMS Shopa i będę zbijał kasę na czarno, bo o podatku nie słyszałem (co to w ogóle jest?)

Zamykam.
 
Status
Not open for further replies.
Back
Top