• 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!

Lua Problem with raids (Monster with rewardchest)

Tampek

ECHO 'Zarkonia.online';
Joined
Dec 29, 2015
Messages
480
Solutions
5
Reaction score
33
Location
Spain
Hello otland i got some issue on my ot project.

The problem is littlel but no have idea to fix it:
ba900a60b8.jpg


- When monster appear with raid and he have rewardchest enabled players cant open corpse.
- Tested without raids and works perfect.
- Posible bug on sources?

If anyone have one idea to fix it please say me.

Thnx for your time and hail otland!
 
you can edit your events/creature ... when set the target in this monsters set the reward
like it:
Code:
    if target:isMonster() and target:getType():isRewardBoss() then
        target:setReward(true)
    end
 
Code:
function Creature:onTargetCombat(target)
    if not self then
        return true
    end

    if target:isPlayer() then
        if self:isMonster() then
            local protectionStorage = target:getStorageValue(Storage.combatProtectionStorage)
            if target:isMonster() and target:getType():isRewardBoss() then
                target:setReward(true)
                end

            if target:getIp() == 0 then -- If player is disconnected, monster shall ignore to attack the player
                if protectionStorage <= 0 then
                    addEvent(removeCombatProtection, 30 * 1000, target.uid)
                    target:setStorageValue(Storage.combatProtectionStorage, 1)
                elseif protectionStorage == 1 then
                    self:searchTarget()
                    return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
                end

                return true
            end

            if protectionStorage >= os.time() then
                return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
            end
        end
    end

    return true
end

But same problem, maybe idw where put this part xD
 
Code:
function Creature:onTargetCombat(target)
if not self then
return true
end
if target:isMonster() and target:getType():isRewardBoss() then
target:setReward(true)
end
if target:isPlayer() then
if self:isMonster() then
local protectionStorage = target:getStorageValue(Storage.combatProtectionStorage)
if target:getIp() == 0 then -- If player is disconnected, monster shall ignore to attack the player
if protectionStorage <= 0 then
addEvent(removeCombatProtection, 30 * 1000, target.uid)
target:setStorageValue(Storage.combatProtectionStorage, 1)
elseif protectionStorage == 1 then
self:searchTarget()
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end

return true
end

if protectionStorage >= os.time() then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end

return true
end
holy shit, please ident
 
Back
Top