SphereCommunity
Cursed Items - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Expired/Outdated Versions (/Forum-Expired-Outdated-Versions)
+--- Forum: Sphere 51a Help (/Forum-Sphere-51a-Help)
+--- Thread: Cursed Items (/Thread-Cursed-Items)



Cursed Items - Deviling - 09-09-2020 01:43 AM

Hi, guys! I have a very simple script for an item that lowers the character's skills when the item equipped and then returns them.

Code:
ONTRIGGER=EQUIP
if (<src.action>!=-1)
   src.sysmessage You must wait to perform another action.
   return 1
endif
if (<hitpoints>>50)&&(<morez>==0)
    hitpoints=50
endif
if (<hitpoints> < 2)
    src.sysmessage=Your <name> may have been destroer
    remove
    return 1
endif
if (<ATTR>&04)
   ATTR=0
elseif (<ATTR>&04008)
   ATTR=0
endif
if (rand(80)=6)
    more=<more>+-1
    if (<hitpoints> < 2)
        src.sysmessage=Your <name> may have been destroer
        remove
        return 1
    endif
endif
src.tactics=<src.tactics>+250
src.archery=<src.archery>+-100
src.fencing=<src.fencing>+-100
src.swordsmanship=<src.swordsmanship>+-100
src.macefighting=<src.macefighting>+-100
RETURN 0

ONTRIGGER=UNEQUIP
src.tactics=<src.tactics>+-250
src.archery=<src.archery>+100
src.fencing=<src.fencing>+100
src.swordsmanship=<src.swordsmanship>+100
src.macefighting=<src.macefighting>+100

RETURN 0

ONTRIGGER=SPELL
RETURN 1

ONTRIGGER=PICKUP_PACK
if (<hitpoints> < 2)
    src.sysmessage=Your <name> may have been destroer
    remove
    return 1
endif

My question is this: when the item is equipped and the character's skill is lowered, the server allows it to be re-pumped. How can I stop this process and prevent players from pumping a reduced skill?


RE: Cursed Items - jdchixin - 12-09-2020 09:06 AM

I don't quite understand your question,are you saying " When the player's skill increases, the skill will decrease when the system saved"

Is that your question?


When the player's skill is greater than 200.0,when server saved ,the skill will restore to 100.0


RE: Cursed Items - amonvangrell - 12-28-2020 03:57 PM

I think what he meant was that a skill lowered by an item was being raised by players... potentially creating a cheat for players to have moren than 100.0 of the given skill once the item was removed.

I am not too sure how to prevent the player to gain skill while using the item, but to prevent bugs, u could store the skill lvl the lowered skill on a TAG0 (when the item is equiped) and return its value once the player remove the item.

U could also add to the sphere_skills.scp (not sure if the name is still this one) a on=@success (under the skill lowered) a check for a TAG0 and return it to -1, not sure if this would prevent the skill to be raised but worthed to give it a try...
cheers