• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

[TFS 1.4] Rarity Rolls & Custom Attributes Library Bug?

Stewartt

Member
Joined
Jan 14, 2022
Messages
13
Reaction score
24
Location
Canada
Hey hope y'all good.
Im having problems with this amazing system [TFS 1.X] Rarity Rolls & Custom Attributes Library (https://otland.net/threads/tfs-1-x-rarity-rolls-custom-attributes-library.268888/)
Im using TFS 1.4 (latest one 12.85 from here: GitHub - otland/forgottenserver: A free and open-source MMORPG server emulator written in C++ (https://github.com/otland/forgottenserver)) i even managed to install the system/compile everything without any error/warning.
But the monsters doesn't drop any single "rarity item"
127.0.0.1_PzHHAf8jRH.gif
Tried spawning tons of mobs none of them drop rarity items but if i use /roll it works, how i can i make it work so monsters can drop rarity items without using /roll everytime?
PD: no error in console or warning so i don't really know
thanks in advance
 

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,527
Solutions
260
Reaction score
4,506
maybe you did something wrong with the onSpawn and onDropLoot part since the tutorial is kinda outdated since eventcallbacks were implemented
 
OP
OP
Stewartt

Stewartt

Member
Joined
Jan 14, 2022
Messages
13
Reaction score
24
Location
Canada
Not sure tbh the OnSpawn thing was already implemented and since i don't get any error/warning i don't have a clue what could be wrong : ( such an amazing system

Using /roll it works but only this way
127.0.0.1_pOho1LiolS.gif
So yeah probably something OnDropLoot/OnSpawn needs to be updated : /
 
Last edited:

Leo32

Getting back into it...
Joined
Sep 21, 2007
Messages
981
Solutions
14
Reaction score
507
someone more familar with TFS 1.4 event callbacks would need to figure out where to place this code:

i have no idea how the new event callbacks work:
 

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,527
Solutions
260
Reaction score
4,506
someone more familar with TFS 1.4 event callbacks would need to figure out where to place this code:

i have no idea how the new event callbacks work:
code was just moved to somewhere else: forgottenserver/default_onDropLoot.lua at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/data/scripts/eventcallbacks/monster/default_onDropLoot.lua)

and now you can simply create a callback like this instead of changing the main function:

Lua:
local ec = EventCallback

function ec.onDropLoot(monster, corpse)
    -- Apply rarity chance to corpse contents and apply animation
    if rollRarity(corpse) > 0 then -- If a rare item was rolled, play animation
        if rare_popup then
            local spectators = Game.getSpectators(corpse:getPosition(), false, true, 7, 7, 5, 5)
            for i = 1, #spectators do
                spectators[i]:say(rare_text, TALKTYPE_MONSTER_SAY, false, spectators[i], corpse:getPosition())
            end
        end
        if rare_effect then
            corpse:getPosition():sendMagicEffect(rare_effect_id)
        end
    end
end

ec:register(-1)
 

Gubailovo

Active Member
Joined
Dec 19, 2013
Messages
335
Solutions
2
Reaction score
43
Hey hope y'all good.
Im having problems with this amazing system [TFS 1.X] Rarity Rolls & Custom Attributes Library (https://otland.net/threads/tfs-1-x-rarity-rolls-custom-attributes-library.268888/)
Im using TFS 1.4 (latest one 12.85 from here: GitHub - otland/forgottenserver: A free and open-source MMORPG server emulator written in C++ (https://github.com/otland/forgottenserver)) i even managed to install the system/compile everything without any error/warning.
But the monsters doesn't drop any single "rarity item"
View attachment 64767
Tried spawning tons of mobs none of them drop rarity items but if i use /roll it works, how i can i make it work so monsters can drop rarity items without using /roll everytime?
PD: no error in console or warning so i don't really know
thanks in advance
did you manage it? tell me the solution
 
Top