• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Revscripts(1.3) Custom Equipment {SYC}

Has anyone made any progress with this?
 
Haven't tested this yet, just finished it. There are some prints that could be removed and some cleaning up to do, but I know its been a long time since I updated so I'll share right away for anyone who has been waiting. I do believe I addressed all issues. We are down to 1 onHealthChange event now, and conditions are more precisely controlled, everything should work, if anything at all doesn't, it would be the manashield possibly, if that is the case let me know, it might be from the use of the unique id.

anyways, here you go guys.



Post automatically merged:

I will update main post if people try this version without more problems
Post automatically merged:

as if it were a reward from a quest,
you can use this function

LUA:
Player:addCustomEquipment(equipId)

in an action or some other type of script to add a custom equipment item to a player's inventory. You just need to use the equipId from the xml file
 

Attachments

Last edited:
Ok so I did some testing and man it was such a pain for the manashield, and I have no idea what I was doing in some of those parts of the logic for the conditions, but now I have fixed manashield (@Evil Puncker ), reflecting (@Raikou ), and everything else for sure, the conditions on the last post were still wonky, basically all worked fine as long as you didn't have manashield for the item... but then if you did, not all conditions would be removed, and manashield was never removed. Reflect and absorb were misbehaving since before the last post due to the replication of the onHealthChange event as @Raikou had pointed out.

I also found a very serious bug when I was testing these out... so apparently in the onDeEqupItem() event, I would check to see if the item was a custom equipment and then remove all the events, which ultimately meant, you could keep adding equipment, but the moment you took off one, the rest that required onHealthChange or onManaChange to function properly, would no longer function properly, as those events would become unregistered!!! SUPER BUG! I honestly don't know how none of us had discovered that yet.... Anyways, its now as it was meant to be, there are maybe some little code optimizations (deleting repeated lines) and such, as well as maybe adding the reflect and absorbs into description, but as it is, its
NOW FULLY FUNCTIONAL AND BUG FREE!

Could I get a mod to update main post with a link to this shared file and the currently used gist link (old one was private and so has changed).

 

Attachments

Last edited:
No bugs to report? Anyone? How's it working for you guys? Has anyone made a cool xml file full of custom equipment yet? Anyone tested out or started utilizing the droploot portion of this system?
 
Trying to implement this with my server now, I'm a little outdated (1.3) and 7.6 fyi. Closest public distro to mine would be nekiros old 7.72 downgrade for reference.

One error I can't solve is your check local group = itemType:getGroup(). I can't find anything about getGroup() regarding items anywhere to update my files so instead have this check commented out as it doesn't seem important and won't let the script load.

Equipping custom items has weird behaviour:

  • Helmet/Weapons/Legs/Shields all work in their respective slots but also work in hands slot
  • Armour does not work in armour slot but works in hand slots
  • Boots do not work in boots slot but work in hands slot

Edit Clarification:
Boots in boot slot don't give buff, but will give buff in hands slot.
Armour in armour slot doesn't give buff, but will give buff in hands slot.
Every custom equipment gives buffs when in hands slot, but not all give buff when in correct slot.


Regular items on my server don't have this issue.

I haven't tested every custom attribute yet but the one's I have tested have all worked and the looting works too 😍. I really enjoy using this system, thanks for sharing it with us :)
 
Last edited:
Trying to implement this with my server now, I'm a little outdated (1.3) and 7.6 fyi. Closest public distro to mine would be nekiros old 7.72 downgrade for reference.

One error I can't solve is your check local group = itemType:getGroup(). I can't find anything about getGroup() regarding items anywhere to update my files so instead have this check commented out as it doesn't seem important and won't let the script load.

Equipping custom items has weird behaviour:

  • Helmet/Weapons/Legs/Shields all work in their respective slots but also work in hands slot
  • Armour does not work in armour slot but works in hand slots
  • Boots do not work in boots slot but work in hands slot

Regular items on my server don't have this issue.

I haven't tested every custom attribute yet but the one's I have tested have all worked and the looting works too 😍. I really enjoy using this system, thanks for sharing it with us :)
I have no idea why you wouldn't have itemType:getGroup() but if you really don't, then you can remove that check, as it is for safety purposes only. You will need to make sure you don't accidentally put an item in the xml that isn't an actual item you can equip, such as a potion, food, trees, bushes, buildings ect.

To make the alteration you need to change lines 189 - 207 to look something like this instead

LUA:
    local itemType = ItemType(properties.baseItem)

        local weaponType = itemType:getWeaponType()
        if weaponType == WEAPON_WAND then
            print("Error item " ..properties.attributes["name"].. " is a wand, wand's are currently not supported, was not added to CustomEquipment!")
        end
        if weaponType == WEAPON_AMMO then
            print("Error item " ..properties.attributes["name"].. " is a type of ammo, ammo type's are not supported, was not added to CustomEquipment!")
        end
        if not table.contains(baseItemList, properties.baseItem) then
            table.insert(baseItemList, properties.baseItem)
        end
        customEquipment[properties.equipId] = properties

end

Then you shouldn't have anymore problems with itemType:getGroup()

As for boots not equipping to boots , but equipping on hands, ect, ect, that is very odd indeed, this will need further investigation on my part.
 
As for boots not equipping to boots , but equipping on hands, ect, ect, that is very odd indeed, this will need further investigation on my part.
Thank you :)

I re-read my post and i think i need to clarify the behaviour of the items when equipping them.
All items equip correctly, boots go to boots slot, armour goes to armour slot etc it is the custom attributes from this system that "do not work".
Example:
Boots on boots slot = no buff
Boots on hands = buff

I will edit my post to make it clear too.
 
I don't have those problems @Silba , but at any rate, this system pretty much is not necessary anymore, really only benefit from this is droploot, and being able to use same id again, since everything else was pretty much added with this commit


I may remake the parts of this system that are still beneficial from scratch for 1.5 revscripts one day, but for now, this system is obsolete.
 
I don't have those problems @Silba , but at any rate, this system pretty much is not necessary anymore, really only benefit from this is droploot, and being able to use same id again, since everything else was pretty much added with this commit


I may remake the parts of this system that are still beneficial from scratch for 1.5 revscripts one day, but for now, this system is obsolete.
I'm still trying to figure out why it happened(albeit slowly), must be something quirky with my sources. Thank you for the link, I'm going to implement this asap.

The droploot is very useful indeed, and as a whole this has been huge in helping me understand and learn so thank you very much for sharing this, I look forward to your potential remake.
 
@Codinablack
I have been testing it, but it seems the mana regeneration does not apply.
Not sure why not, still testing it what is going on.
 
@Codinablack
I have been testing it, but it seems the mana regeneration does not apply.
Not sure why not, still testing it what is going on.
you are using this version?

last I knew everything had worked fine, and mana generation had never even been on the list of issues, but if you aren't using the latest version make sure to switch to it, but like I said, support for this is dropped due to most of all of this being directly in the items.xml now on the master branch.
 
you are using this version?

last I knew everything had worked fine, and mana generation had never even been on the list of issues, but if you aren't using the latest version make sure to switch to it, but like I said, support for this is dropped due to most of all of this being directly in the items.xml now on the master branch.

Yep, but i fixed it for myself now.

See the code in the attached file.

Basically I changed the type like here:
LUA:
local equipConditions = {
    ["healthgain"] =                  {type = CONDITION_REGENERATION,          param = CONDITION_PARAM_HEALTHGAIN,},
    ["managain"] =                    {type = CONDITION_REGENERATION,            param = CONDITION_PARAM_MANAGAIN,},

and then I adjusted the processing here:
LUA:
                if key.type == CONDITION_REGENERATION then
                    if key.param == CONDITION_PARAM_HEALTHGAIN then
                        condition:setParameter(key.param, _value)
                        condition:setParameter(CONDITION_PARAM_HEALTHTICKS, healthTicks)
                        self:addCondition(condition)
                    end
                    if key.param == CONDITION_PARAM_MANAGAIN then
                        condition:setParameter(key.param, _value)
                        condition:setParameter(CONDITION_PARAM_MANATICKS, manaTicks)
                        self:addCondition(condition)
                    end           
                end

I hope it's clear :)
 

Attachments

Yep, but i fixed it for myself now.

See the code in the attached file.

Basically I changed the type like here:
LUA:
local equipConditions = {
    ["healthgain"] =                  {type = CONDITION_REGENERATION,          param = CONDITION_PARAM_HEALTHGAIN,},
    ["managain"] =                    {type = CONDITION_REGENERATION,            param = CONDITION_PARAM_MANAGAIN,},

and then I adjusted the processing here:
LUA:
                if key.type == CONDITION_REGENERATION then
                    if key.param == CONDITION_PARAM_HEALTHGAIN then
                        condition:setParameter(key.param, _value)
                        condition:setParameter(CONDITION_PARAM_HEALTHTICKS, healthTicks)
                        self:addCondition(condition)
                    end
                    if key.param == CONDITION_PARAM_MANAGAIN then
                        condition:setParameter(key.param, _value)
                        condition:setParameter(CONDITION_PARAM_MANATICKS, manaTicks)
                        self:addCondition(condition)
                    end          
                end

I hope it's clear :)
Excellent find and fix my friend! Absolutely love it :D

Those looking for newest, should try his above attachment, appears only edit is the fix so its solid I think, but I also applied his fix to mine for the github gist.
 
Boots on boots slot = no buff

I think I found the fix for your problem, but I'm still concerned the mainly weird behavior you have is from itemtype:getGroup() not being a method for you, will probably need that section of logic re-written to fit your server, but this might work.

Search for "for key , id in pairs(baseItemList) do" and find:

LUA:
for key , id in pairs(baseItemList) do
    local equipEvent = MoveEvent()
    local deEquipEvent = MoveEvent()
   
    equipEvent:id(id)
    deEquipEvent:id(id)

replace it with:


LUA:
for key , id in pairs(baseItemList) do
    local equipEvent = MoveEvent()
    local deEquipEvent = MoveEvent()
    local slot = ItemType(id):getSlotPosition()

    equipEvent:id(id)
    deEquipEvent:id(id)
    equipEvent:slot(slot)
    deEquipEvent:slot(slot)



if its still not working correctly, please let me know.
Please make sure in the items.xml the original item has a slotType set
 
I've been trying to add more items now, and I run into several things that maybe is easy to fix or maybe it isn't.
First thing is if I have an existing armor let's say voltage armor. If I want to make this also into custom the following things are breaking.

  • Custom Armor: The original has 2 vocations knight/paladin. This isn't possible with custom
  • Original Armor: The original will lose the level and vocation cap, because it has to be removed at movements
I'm not sure what to change to make these things work properly.

EDIT
I adjusted the script for multi-vocation.
What I changed is as followed:

LUA:
                if eq.requirements["vocation"] then
                    local vocation = Vocation(eq.requirements["vocation"])
                    if vocation then
                        if vocation ~= (player:getVocation() or player:getVocation():getDemotion()) then
                            player:sendTextMessage(MESSAGE_INFO_DESCR,"You don't have the proper vocation to equip that item!")
                            return false
                        end
                    end
                end
Into this:
LUA:
                local vocationMatch = false
                if eq.requirements["vocation"] then
                    for word in string.gmatch(eq.requirements["vocation"], '([^,]+)') do
                        local vocation = Vocation(word)
                        if vocation == (player:getVocation() or player:getVocation():getDemotion()) then
                            vocationMatch = true
                        end
                    end              
                    if vocationMatch == false then                  
                        player:sendTextMessage(MESSAGE_INFO_DESCR,"You don't have the proper vocation to equip that item!")
                        return false
                    end
                end
In the XML you have to place the vocations comma seperated.
For example: knight,paladin
 
Last edited:
Aún no lo he probado, acabo de terminarlo. Hay algunas impresiones que podrían eliminarse y algunas limpiezas que hacer, pero sé que ha pasado mucho tiempo desde que actualicé, así que las compartiré de inmediato con cualquiera que haya estado esperando. Creo que abordé todas las cuestiones. Ahora solo queda 1 evento en HealthChange, y las condiciones se controlan con mayor precisión, todo debería funcionar, si algo no funciona, posiblemente sea el escudo de maná, si ese es el caso, avíseme, podría ser por el uso. de la identificación única.

De todos modos, aquí tenéis chicos.

https://gist.github.com/Codinablack/156f5d9febbaa296b525bc3353c94ac0


[autofusión]1641966815[/autofusión]
Actualizaré la publicación principal si la gente prueba esta versión sin más problemas.
[autofusión]1641970509[/autofusión]

puedes usar esta función

LUA:
Jugador:addCustomEquipment(equipId)

en una acción o algún otro tipo de script para agregar un elemento de equipo personalizado al inventario de un jugador. Sólo necesitas usar el equipId del archivo xml.


LUA:
Error de secuencia de comandos de Lua: [Interfaz de secuencias de comandos]
C:\Users\Martin\Downloads\ProjectoKabo\Server Baiak-Kabo\baiakthunder-master\data\scripts\Custom Equpiment\customequpiment.lua
...master\data\scripts\Custom Equpiment\customequpiment.lua:73: intento de indexar el 'equipmentFile' local (un valor nulo)
rastreo de pila:
        [C]: en la función '__index'
        ...master\data\scripts\Custom Equpiment\customequpiment.lua:73: en el fragmento principal
[QUOTE] equipopersonalizado.lua [error][/QUOTE]
^[/CÓDIGO]


en la version 1.5
 
Hiho guys :P anyone got this to work with 8.6 nekiro tfs 1.5 downgrade? i have no errors but it does not seem to work :P
 
Back
Top