DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 12, 2018, 10:57:05 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Hidden Chests  (Read 2769 times)
0 Members and 1 Guest are viewing this topic.
Eth
Member
Codemeister
****
Offline Offline

Posts: 302


Shameless Drunk


View Profile
« on: January 11, 2006, 08:08:57 PM »

This is a combination of a forest event and normal module. While adventuring through the forest, players can happen upon a chest hidden in some bushes. With this chest, they can store a limited amount of gold and gems that will stay safe between DK's.

Forgot to mention this: Players can find a link to their chest via the Forest screen.

Features:
  • Limited number available
  • DK limit to find a chest
  • Can set amount of gold and gems stored
  • Can set chance to lose after a DK (player forgets where it's at)
  • Can set overall chance for finding a chest

This was just a mod I had sitting on my todo list, and figured I'd throw it out there for anyone who's interested. Enjoy!

Linkage - Hidden Chest 1.0:
http://dragonprime.net/users/Eth/hiddenchest.zip
« Last Edit: January 11, 2006, 08:12:35 PM by Eth » Logged

Purveyor of fine cloaks, gloves, boots, gerbils, and Siamese cats.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1746


View Profile
« Reply #1 on: April 18, 2008, 08:19:59 PM »

Code:
#
#-----[ FILE ]-----
#
modules/hiddenchest.php

#
#-----[ FIND ]-----
#
$gold = round(httppost('hiddengold'));
$gems = round(httppost('hiddengems'));

#
#-----[ REPLACE WITH ]-----
#
$gold = abs((int)httppost('hiddengold'));
$gems = abs((int)httppost('hiddengems'));

If you enter a negative value into either field you'll get this,

Not something you want happening. Smiley
Logged

Check My Modules for the latest versions.
RaynDarren
Mod God
*****
Offline Offline

Posts: 732


View Profile WWW
« Reply #2 on: April 24, 2008, 04:41:51 PM »

Code:
#
#-----[ FILE ]-----
#
modules/hiddenchest.php

#
#-----[ FIND ]-----
#
$gold = round(httppost('hiddengold'));
$gems = round(httppost('hiddengems'));

#
#-----[ REPLACE WITH ]-----
#
$gold = abs((int)httppost('hiddengold'));
$gems = abs((int)httppost('hiddengems'));

If you enter a negative value into either field you'll get this,

Not something you want happening. Smiley

You also can enter -1000000000;; in either the gold OR gem field and get a positive number stored. As afkamm said, you do get it in your hand, but in my experience, this is ONLY TEMPORARY. It removes after clicking "go back" then both the gems and gold are stored.

 -1000000000 gold taken from chest.
-1000000000 gems taken from chest.
 
from the withdraw screen:

How much gold or gems would you like to take from your chest?

You currently have 1000000000 gold and 2000000000 gems stored.

From the withdraw complete screen:

 0 gold taken from chest.
-1000000000 gems taken from chest.
 
Personal Info
Gold 0
Gems -1000000000

from withdraw:

You currently have 1000000000 gold and 3000000000 gems stored.

Personal Info
Gold 0
Gems 0

(appologies for the 2 and 3 billion there instead of 1 and 2, I've done it already once to test, with gems only.)
« Last Edit: April 24, 2008, 04:44:02 PM by RaynDarren » Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
37 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search