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

Revscripts(1.3) Custom Equipment {SYC}

@Raikou

I updated main post now with everything, including configurations for healthgain ticks, managain ticks, soul correctly working, and fix for the nil error for reflects/absorbs/elementaldmg
Except for the part that reflect heals the monster instead of damages. But i can fix that.
 
Except for the part that reflect heals the monster instead of damages. But i can fix that.
What exactly caused that? What did the equipment look like in the xml, which monster and which spell/attack did it use?
 
XML:
    <equipment baseItem="2400" equipId="24002" article="a" name="blade of the ruined king">
        <equip attr="description" value="for adc's" />
        <equip attr="defense" value="48" />
        <equip attr="attack" value="99" />
        <equip attr="extradef" value="15" />
        <equip skill="sword" value="5" />
        <equip skill="distance" value="2" />
        <equip crit="chance" percent="90" />
        <equip crit="amount" percent="85" />
        <equip buff="healthgain" value="50" />
        <equip reflect="physical" percent="50"/>
    </equipment>
ajsD3e2.png

It is the one that was in from the beginning.
I tested with my knight against a behemoth, and if he hits me with 100, he heals with 100.

The lua what i found suspicious is:

Lua:
    if reflectDamage > 0 then
        player:say("reflecting")
        --attacker:addHealth(-reflectDamage)
        doTargetCombat(attacker:getId(), attacker, primaryType, reflectDamage, reflectDamage, CONST_ME_NONE) -- can be exploited.
    end
Why 2 times reflectDamage?
 
XML:
    <equipment baseItem="2400" equipId="24002" article="a" name="blade of the ruined king">
        <equip attr="description" value="for adc's" />
        <equip attr="defense" value="48" />
        <equip attr="attack" value="99" />
        <equip attr="extradef" value="15" />
        <equip skill="sword" value="5" />
        <equip skill="distance" value="2" />
        <equip crit="chance" percent="90" />
        <equip crit="amount" percent="85" />
        <equip buff="healthgain" value="50" />
        <equip reflect="physical" percent="50"/>
    </equipment>
ajsD3e2.png

It is the one that was in from the beginning.
I tested with my knight against a behemoth, and if he hits me with 100, he heals with 100.

The lua what i found suspicious is:

Lua:
    if reflectDamage > 0 then
        player:say("reflecting")
        --attacker:addHealth(-reflectDamage)
        doTargetCombat(attacker:getId(), attacker, primaryType, reflectDamage, reflectDamage, CONST_ME_NONE) -- can be exploited.
    end
Why 2 times reflectDamage?
Lua:
function doTargetCombatMana(cid, target, min, max, effect)
min max
XML:
    <equipment baseItem="2400" equipId="24002" article="a" name="blade of the ruined king">
        <equip attr="description" value="for adc's" />
        <equip attr="defense" value="48" />
        <equip attr="attack" value="99" />
        <equip attr="extradef" value="15" />
        <equip skill="sword" value="5" />
        <equip skill="distance" value="2" />
        <equip crit="chance" percent="90" />
        <equip crit="amount" percent="85" />
        <equip buff="healthgain" value="50" />
        <equip reflect="physical" percent="50"/>
    </equipment>
ajsD3e2.png

It is the one that was in from the beginning.
I tested with my knight against a behemoth, and if he hits me with 100, he heals with 100.

The lua what i found suspicious is:

Lua:
    if reflectDamage > 0 then
        player:say("reflecting")
        --attacker:addHealth(-reflectDamage)
        doTargetCombat(attacker:getId(), attacker, primaryType, reflectDamage, reflectDamage, CONST_ME_NONE) -- can be exploited.
    end
Why 2 times reflectDamage?

min,max
 
exactly this


from the picture it appears to worked correctly!? I see half the damage the player received (38 damage) and half was reflected (38 damage) to the monster... I do not see the monster healing in that picture you posted.
It shows I got hit by 38 and the monster got healed 38 notice the difference in colour.
Post automatically merged:

Oh i have noticed the damageProcessor is also not registered like the others.
Post automatically merged:

Digging even deeper into your script and it looks if i register the damageProcessor things overlap.
I also made things a bit more easy for me so i adjusted what the reflect says.
So it is indeed 50% of what is also shown on the sword, but it reflects it as a heal on the monster, this i could fix easily.
Ill show the script i`m using currently which is without the damageProcessor, since it seems to overlap and isn't even registered in the first place.
The script also have the backpack slot included and an extra function i made for my special loot drop system.
 
Last edited:
It shows I got hit by 38 and the monster got healed 38 notice the difference in colour.
Post automatically merged:

Oh i have noticed the damageProcessor is also not registered like the others.
Post automatically merged:

Digging even deeper into your script and it looks if i register the damageProcessor things overlap.
I also made things a bit more easy for me so i adjusted what the reflect says.
So it is indeed 50% of what is also shown on the sword, but it reflects it as a heal on the monster, this i could fix easily.
Ill show the script i`m using currently which is without the damageProcessor, since it seems to overlap and isn't even registered in the first place.
The script also have the backpack slot included and an extra function i made for my special loot drop system.
I'm not sure what you mean by overlap in damage processor, but I'm at work and can't look right now. The picture still doesn't look like healing to me, just different damage colors, but if you are certain it's healing then the fix is easy, change the two "reflectDamage" you noticed before, to "-reflectDamage" and then should be fixed, looks like I just forgot to put the "-"

I still see 38 as a damage number healing numbers don't show up that color.... I think your monster is healing from something else, but like I said, if you are certain, then just put the minus sign Infront of reflectDamage and viola
 
Yea, i added it on there so it worked out.
The behemoth get's a little less damage because of it's physical reduction (10%).
CkFvRg8.png

See the script I got in the attachment.
For reflecting when you have mana shield it seems not to be working.
 

Attachments

  • customequpiment.lua
    41.5 KB · Views: 11 · VirusTotal
Lua:
local damageEvent = CreatureEvent("DamageProcessor")

function damageEvent.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)

    
local healthEvent = CreatureEvent("HealthProcessor")

function healthEvent.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
He's trying to say these two are the same thing.
 
Lua:
local damageEvent = CreatureEvent("DamageProcessor")

function damageEvent.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)

   
local healthEvent = CreatureEvent("HealthProcessor")

function healthEvent.onHealthChange(player, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
He's trying to say these two are the same thing.
Those should indeed be merged into one, which I planned on doing since I made mana event, but one is for elemental damage and other for absorbs and reflects. But he said it doesn't work correctly with mana shield on, which is only different from the other two by checking if manashield is on and combining all same logic from other two into one, so combining might not be a good idea, idk, give me some time buddy, I'll look into it when I can and do my own testing, try to clean up any bugs left
 
Yes, if you have the loot enabled, and the items as lootable with loot chance in the xml, then anytime a monster that dies with an item id that matches any baseItem in the xml file, it has a chance to drop the custom equipment
 
Yes, if you have the loot enabled, and the items as lootable with loot chance in the xml, then anytime a monster that dies with an item id that matches any baseItem in the xml file, it has a chance to drop the custom equipment
but I meant to show the item, as if it were a reward from a quest, without the need to put the description of the item on some poster; By the way, when you equip the supreme kai armor, it has an attribute that when equipping it increases your magic level by 25 but when you take it off the magic level is still present.
 
but I meant to show the item, as if it were a reward from a quest, without the need to put the description of the item on some poster; By the way, when you equip the supreme kai armor, it has an attribute that when equipping it increases your magic level by 25 but when you take it off the magic level is still present.
Yes, it appears I broke some of the conditions along the way, trying to get that pain in the ass manashield to work correctly , seems that equipping certain eq, will lower your hp or mana immediately too now, I will try to get it all fixed and cleaned this weekend buddy, as for placing the eq on the map so players can see the reward, you would need a script to do that for you.
 
This thing is amazing
Cbs Reaction GIF by The Late Late Show with James Corden


Are this kind of script/mod support added by default in current tfs? Or I need to download a specific branch?
 
Back
Top