The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cursed Items
Author Message
Deviling
Apprentice
*

Posts: 1
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Sep 2020
Reputation: 0



Post: #1
Cursed Items
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?
(This post was last modified: 09-09-2020 01:47 AM by Deviling.)
09-09-2020 01:43 AM
Find all posts by this user Like Post Quote this message in a reply
jdchixin
Journeyman
*

Posts: 51
Likes Given: 9
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #2
RE: Cursed Items
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
(This post was last modified: 12-09-2020 09:09 AM by jdchixin.)
12-09-2020 09:06 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #3
RE: Cursed Items
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
12-28-2020 03:57 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)