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-nmm6 (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-nmm6 (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-nmm6 (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
Locked Containers with Loot
Author Message
Hustensaft
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #1
Locked Containers with Loot
Hi all,

i'm planning to add some locked Containers with a little Gold for some thieving in Dungeons. Now i face some problems and i have no idea how to solve them.

Code:
[ITEMDEF i_loot_barrel]
ID=i_barrel
NAME=Ancient Barrel
TYPE=T_CONTAINER_LOCKED

1. Problem with this line, if i spawn this Container, it is not locked and is t_container, not t_container_locked

Code:
CATEGORY=Staff
SUBSECTION=Dungeons
DESCRIPTION=Loot Barrel

ON=@Create
    ATTR=attr_decay|attr_move_never

2. Problem with this line, Server gives an error, Decay Flag without timer. I have to use a timer to set the decay time?

Code:
    color=0349    
    MORE1=01
    MORE2=0350

Sphere Wiki says, the last line is the difficulty to unlock the container. Does this mean, e.g. 0350 stands for at least 35,0% in lockpicking needed?

Code:
    NEWITEM=i_gold,{100 200}
        ...?

Here i am totally stuck. How do i get some Gold inside this container?
04-28-2013 11:30 AM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #2
RE: Locked Containers with Loot
A container is locked only if it has a key... as you noticed, the wiki describes containers as:

Quote: MORE1 = "ID" from the key that can unlock this item (If the MORE1 of the key matches the MORE1 of the container then they are linked)
MORE2 = The lock complexity (how hard it is to pick the lock)
MOREX = The trap type (not used yet?)
TDATA2 = The gumpID of the container (this is not an ITEMDEF)
TDATA3 = The minimum gump size
TDATA4 = The maximum gump size
LINK = UID of a secondary key?

A item of what you describe can be implemented in a variety of ways... if you spawn it using an item spawner, then it *should* decay and the @timer trigger should NOT end in return 1 (which would prevent the decay.) but since you set attr_move_never, maybe you need to use attr_can_Decay instead of attr_decay... I am not certain about this, you need to experiment (please report back with the results so everyone will learn).

Difficulty is 1-1000 I think... 0350 is a hex number that equates to 848... which probably means 84.8% (or 84.8 lockpicking skill?)

To load the container, do something like this in @Create trigger:

Code:
//serv.newitem=item,amount,containerID
SERV.NEWITEM=i_gold,500,<UID>
SERV.NEWITEM=i_katana,1,<UID>
(This post was last modified: 04-28-2013 12:33 PM by RanXerox.)
04-28-2013 12:32 PM
Find all posts by this user Like Post Quote this message in a reply
Hustensaft
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #3
RE: Locked Containers with Loot
Thanks a lot, works great. I tried both attr_can_decay and attr_decay and both worked without any errors. I tried to add a Key to these Containers, but when there is an existing key, the Lock is not pickable, even for a Staffchar. So i lock the Container now with
ON=@CREATE
TYPE=t_container_locked
wich works well.

I have not really tested the More2 Stuff (my Staffchar picks every Lock, no matter what Skill), i hope my Girlfriend will help me testing this soon Smile
04-29-2013 02:47 AM
Find all posts by this user Like Post Quote this message in a reply
Hustensaft
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2013
Reputation: 0



Post: #4
RE: Locked Containers with Loot
I now tested with the More2 on the locked containers, this doesn't seem to work at all. As far as a charakter has Lockpicking 20, he picks every Container in the first try, no matter what I set to More2.

Maybe I can block picking too complex Containers directly in the Skills.scp with a @Start or @PreStart, gonna test this way.
04-29-2013 10:42 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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