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
Resource Gate
Author Message
Ultima One
Journeyman
*

Posts: 238
Likes Given: 7
Likes Received: 10 in 6 posts
Joined: Jan 2013
Reputation: 6

Ultima One

Post: #1
Resource Gate
Time to share some scripts we use frequently on TUP. Some may be in need of updating.

Gates which can be set to require a certain amount of a certain resource in order to pass, or it can give you items when you step on it then send you past it. Fun to use in Events.

Code:
//////////////////////////////////////////////RESOURCE GATES///////////////////////////////////////////
//Variables:                                                                 //
//TAG.RESOURCEID - ID of the resource the gate will look for                                         //
//TAG.AMOUNTREQUIRED - The amount the gate requires you to have                                      //
//TAG.CONSUMEAMOUNT - The amount the gate will consume                                                 //
//TAG.AMOUNTTOGIVE - The amount the gate will give you if you don't have any                         //
//MOREP - The Coordinates of where the gate will take you if you meet the requirements               //
//                                                                         //
//General Info:                                                                            //
//Double-click to configure...variables really tell everything else...                               //
///////////////////////////////////////////////////////////////////////////////////////////////////////

[ITEMDEF i_Resource_Gate]
ID=i_moongate_blue
TYPE=t_script
NAME=Resource Gate

ON=@CREATE
   COLOR=07a1

ON=@DCLICK
   IF (<SRC.ACCOUNT.PLEVEL> > 1)
      DIALOG d_ResourceGate
   ENDIF
   RETURN 1

ON=@STEP
   IF (<EVAL <TAG.RESOURCEID>>=0)
      SRC.SYSMESSAGE This tile has not been configured for entry yet.
      RETURN 1
   ENDIF

   IF !(<EVAL <TAG.AMOUNTTOGIVE>>=0)
      IF !<SRC.FINDID.<TAG.RESOURCEID>.UID>
         SRC.NEWITEM <TAG.RESOURCEID>
         SRC.ACT.AMOUNT=<EVAL <TAG.AMOUNTTOGIVE>>
         SRC.ACT.BOUNCE
      ENDIF
   ENDIF

   IF <SRC.RESTEST <EVAL <TAG.AMOUNTREQUIRED>> <TAG.RESOURCEID>>

      IF !(<EVAL <TAG.CONSUMEAMOUNT>>=0)
         SRC.CONSUME=<EVAL <TAG.CONSUMEAMOUNT>> <TAG.RESOURCEID>
      ENDIF

     SRC.GO <MOREP>
   ENDIF

   RETURN 1

CATEGORY=Miscellaneous
SUBSECTION=Gates
DESCRIPTION=Resource Consumption Gate


[DIALOG d_ResourceGate]
0,0

resizepic 190 175 5054 390 250
resizepic 200 185 3000 370 230

//Text Borders
resizepic 370 200 3000 185 22
resizepic 370 235 3000 185 22
resizepic 370 270 3000 185 22
resizepic 370 305 3000 185 22
resizepic 370 340 3000 185 22

text 215 200 995 1
text 215 235 995 2
text 215 270 995 3
text 215 305 995 4
text 215 340 995 5

//Text where coordinates will be entered.
textentry 375 200 175 25 0 0 6
textentry 375 235 175 25 0 1 7
textentry 375 270 175 25 0 2 8
textentry 375 305 175 25 0 3 9
textentry 375 340 175 25 0 4 10

text 295 375 0000 11
button 260 375 4005 4006 1 0 1

text 465 375 0000 12
button 430 375 4005 4006 1 0 0


[DIALOG d_ResourceGate TEXT]
<VAR.BLANKLINE>
Resource ID:
Amount Required:
Amount to Consume:
Amount to Give:
Coordinates:
<TAG.RESOURCEID>
<EVAL <TAG.AMOUNTREQUIRED>>
<EVAL <TAG.CONSUMEAMOUNT>>
<EVAL <TAG.AMOUNTTOGIVE>>
<MOREP>
Accept
Cancel


[DIALOG d_ResourceGate BUTTON]
ON=0
   SRC.SYSMESSAGE No changes made.
   RETURN 1

ON=1
   TAG.RESOURCEID=<ARGTXT[0]>
   TAG.AMOUNTREQUIRED=<ARGTXT[1]>
   TAG.CONSUMEAMOUNT=<ARGTXT[2]>
   TAG.AMOUNTTOGIVE=<ARGTXT[3]>
   MOREP=<ARGTXT[4]>
   RETURN 1

ULTIMA ONE
The modern, sphere powered Ultima Online server
(This post was last modified: 05-16-2013 01:12 AM by Ultima One.)
05-16-2013 01:12 AM
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: 1 Guest(s)