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

Feature Reward Chest & Boss Reward [TFS 1.2]

may someone help make it work for tfs 1.4.2?
I dont find it available for 1.4 heres i script i found that could be handy for you. kinda mimics the purpose
Lua:
local config = {
    ["Ferumbras Mortal Shell"] = {
        loot = {{25172,100,3},{2152,80,25},{7632,50,1},{2127,90,1},{25382,30,1},{25383,28,1},{25522,25,1},{25523,25,1},{2446,20,1},{7885,20,1},{7896,25,1},{7832,18,1},{25423,13,1}, {7894,19,1}, {7895,20,1}, {25429,11,1}, {25423,13,1}, {25422,9,1}, {2520,10,1}, {2514,9,1}, {25427,7,1}, {8885,5,1}, {7388,9,1}, {25837,6,1}, {25390,6,1}, {25393,5,1}, {7418,8,1}, {8926,4,1}, {7403,4,1}, {2472,6,1}, {8928,3,1}, {8868,3,1}, {8918,3,1}, {8904,2,1}, {8930,2,1}, {2529,1,1}, {8869,7,1}},
        message = "Congratulation For Ferumbras Mortal Shell,Your Reward is now in bag",
        effect = CONST_ME_SOUND_PURPLE,
        use_stats = false,
        chance_attr = {{'lifesteal',5,{3,7},{"melee","wand","dist"}},{'dodge',5,{1,5},{"armor"}}},
        animatedText = {COLOR_BLUE,"YA!"},
        SendToDepot = false,
        BagId = 9775
    },
    ["Deathstrike"] = {
        loot = {{18430,100,1},{18465,9,1},{18453,20,1},{18451,16,1},{18454,17,1},{18450,12,1},{18452,8,1},{18449,4,1}},
        message = "Congratulation For Defeating Deathstrike,Your Reward is now in bag",
        effect = CONST_ME_SOUND_YELLOW,
        use_stats = false,
        chance_attr = {{'lifesteal',4,{3,7},{"melee","wand","dist"}},{'critical',4,{1,5},{"armor"}}},
        animatedText = {COLOR_MAYABLUE,"YA!"},
        SendToDepot = false,
        BagId = 2000
    },
    ["Abyssador"] = {
        loot = {{18496,100,1},{18465,9,1},{18453,20,1},{18451,16,1},{18454,17,1},{18450,12,1},{18452,8,1},{18449,4,1}},
        message = "Congratulation For Defeating Abyssador,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = true,
        BagId = 9775
    },
    ["Shulgrax"] = {
        loot = {{25172,100,1},{2152,90,20},{18910,60,5},{18411,15,1},{20108,25,1},{2155,10,1},{2158,25,1},{2156,27,1},{25383,17,1},{25523,15,1},{25412,3,1},{25418,3,1},{8920,10,1}, {2154,10,1},{2155,11,1},{7451,12,1},{24850,30,6},{24849,35,5}},
        message = "Congratulation For Defeating Shulgrax,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = false,
        BagId = 9775
    },
    ["Plagirath"] = {
        loot = {{25172,100,1},{2152,90,21},{18419,85,6},{18420,85,6}, {18411,15,1}, {18421,85,6},{6500,80,5},{2156,33,1},{2155,35,1},{7885,25,1},{18411,6,1},{11306,8,1},{25383,8,1},{25382,8,1},{25418,4,1}},
        message = "Congratulation For Defeating Plagirath,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = false,
        BagId = 9775
    },
    ["Mazoran"] = {
        loot = {{25172,100,1},{2152,90,21},{18419,85,6},{18420,85,6},{18421,85,6},{6500,80,5},{2156,33,1},{2155,35,1},{2153,12,1},{2432,15,1},{7894,12,1},{18409,15,1},{7890,25,1},{7899,8,1},{7382,6,1},{25418,4,1},{8853,2,1},{25416,2,1},{2542,1,1}},
        message = "Congratulation For Defeating Mazoran,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = false,
        BagId = 9775
    },
    ["Zamulosh"] = {
        loot = {{25172,100,1},{2152,90,21},{6500,80,5},{2169,100,1},{2165,100,1},{18416,66,6},{18417,66,6},{18418,66,6},{2156,33,1},{2155,35,1},{2153,12,1},{25411,4,1},{8878,10,1},{25523,11,1},{25382,13,1},{25418,4,1}},
        message = "Congratulation For Defeating Zamulosh,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = true,
        BagId = 9775
    },
    ["Tarbaz"] = {
        loot = {{25172,100,1},{2152,90,25},{6500,80,5},{18413,80,5},{18414,480,5},{18415,80,5},{2154,15,1},{2156,33,1},{2158,28,1},{7896,22,1},{7897,17,1},{2438,24,1},{7427,16,1},{8910,20,1},{25418,4,1},{25418,4,1}.{25413,2,1}},
        message = "Congratulation For Defeating Tarbaz,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = true,
        BagId = 9775
    },
    ["Ragiaz"] = {
        loot = {{25172,100,1},{6500,80,5},{2152,90,28},{18419,85,6},{18420,85,6},{18421,85,6},{7426,40,1},{25382,18,1},{25383,17,1},{25522,15,1},{2436,25,1},{7632,10,1},{25418,4,1},{7420,4,1},{25414,3,1}},
        message = "Congratulation For Defeating Ragiaz,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = false,
        BagId = 9775
    },
    ["Razzagorn"] = {
        loot = {{25172,100,1},{6500,80,5},{2152,90,27},{24849,85,5},{24850,90,5},{6500,80,5},{2154,10,1},{2153,15,1},{2158,25,1},{2156,20,1},{7443,40,1},{2522,3,1},{25418,4,1},{25383,16,1},{25523,13,1},{25410,1,1}},
        message = "Congratulation For Defeating Hades,Your Reward is now in depot",
        effect = CONST_ME_FIREWORK_RED,
        use_stats = false,
        chance_attr = {{'lifesteal',3,{3,7},{"melee","wand","dist"}},{'critical',3,{1,5},{"all"}}},
        animatedText = {COLOR_RED,"YA!"},
        SendToDepot = true,
        BagId = 9775
    },
    ["Gnomevil"] = {
        loot = {{18495,100,1},{18465,9,1},{18453,20,1},{18451,16,1},{18454,17,1},{18450,12,1},{18452,8,1},{18449,4,1}},
        message = "Congratulation For Defeating Gnomevil,Your Reward is now in depot",
        effect = CONST_ME_HEARTS,
        use_stats = false,
        chance_attr = {{'lifesteal',1,{3,7},{"melee","wand","dist"}},{'critical',1,{1,5},{"armor"}}},
        animatedText = {COLOR_PINK,"YA!"},
        SendToDepot = false,
        BagId = 9775
}
  --[[
  ["NameOfMonster"] = {
  loot = {{itemid,chance,count},{itemid,chance,count}},
  message = "Message produced when you kill the boss",
  effect = "Effect when you kill boss",
  use_stats = false -- if it is true then special attribute will be added
  chance_attr = {{'attribute name',chance,{min,max},{applied weapons}},{'attribute name',chance,{min,max},{applied weapons}}},
  animatedText = {Color of text,"Text produced"},
  SendToDepot = true will send item to the depot, false will send item to player bag auto,
  BagId = dont need explanation
  }
  
  ]]
}
--forgive this part V couldn't think of any better solution
function ItemInfo(array,item)
    for i = 1,#array do
        if(array[i] == "melee")then
            if getItemInfo(item).weaponType == WEAPON_SWORD or getItemInfo(item).weaponType == WEAPON_CLUB or getItemInfo(item).weaponType == WEAPON_AXE then
                return true
            end
        elseif(array[i] == "armor")then
            if getItemInfo(item).armor ~= 0 and getItemInfo(item).wieldPosition ~= CONST_SLOT_NECKLACE then
                return true
            end
        elseif(array[i] == "wand")then
            if getItemInfo(item).weaponType == WEAPON_WAND then
                return true
            end
        elseif(array[i] == "dist")then
            if getItemInfo(item).weaponType == WEAPON_DIST and getItemInfo(item).ammoType ~= 0 then
                return true
            end
        elseif(array[i] == "shield")then
            if getItemInfo(item).weaponType == WEAPON_SHIELD and getItemInfo(item).defense ~= 0 then
                return true
            end 
        elseif(array[i] == "all")then
            return true
        end
    end
    return false
end
--- info scanner End

function onKill(cid, target, damage, flags,war)
    if isPlayer(cid) and isMonster(target) then
        local monster = config[getCreatureName(target)]
        if monster then
            local bag = doCreateItemEx(monster.BagId, 1)
            for i = 1,#monster.loot do
                if monster.loot[i][2] >= math.random(1,100) then -- random chance to get the item
                    local item = doAddContainerItem(bag, monster.loot[i][1],monster.loot[i][3])
                    if (monster.use_stats) then
                        for z = 1,#monster.chance_attr do
                            if(monster.chance_attr[z][2] >= math.random(1,100) and ItemInfo(monster.chance_attr[z][4], monster.loot[i][1]))then
                                doItemSetAttribute(item, monster.chance_attr[z][1], math.random(monster.chance_attr[z][3][1],monster.chance_attr[z][3][2])) -- add attribute
                            end
                        end
                    end
                end
            end
          
            if(getContainerItem(bag, 0).uid > 0)then -- check if the container has items or not
                doSendMagicEffect(getThingPos(cid), monster.effect)
                if monster.SendToDepot then
                    doPlayerSendMailByName(getCreatureName(cid), bag, getPlayerTown(cid), "Admin") -- send to depot
                else
                    doPlayerAddItemEx(cid, bag,true) -- send to bag
                end
                doPlayerSendTextMessage(cid, 25, monster.message)
            else
                doPlayerSendTextMessage(cid, 25, "Better Luck Next Time,You Got No Reward.")
            end
        end
    end
    return true
end
 
Hey guys. Having the same problem as some people here. Reward system is working perfectly, but when i kill a boss with reward system, receive the items and then kill a Dragon (an example for a normal monster), the distro crashes without showing any errors. Someone already figured out what is wrong? TFS 1.3, version 10.98.
 
Back
Top