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
Can anyone help create this function?
Author Message
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Can anyone help create this function?
Can anyone help create this function?

When you get 100 of intelligence, not use the pot
[itemdef i_pote_mana]
NAME = +3 Of Mana
ID = i_flask1_blue_anim
TYPE = t_normal



on = @ dclick
src.modint + = 3
src.anim 17
src.sound snd_spell_gate_travel
consumes one i_flask1_blue_anim
return 1
(This post was last modified: 09-08-2012 03:18 AM by victorstelzer.)
09-08-2012 03:16 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: Can anyone help create this function?
Code:
[itemdef i_pote_mana]
ID = i_flask1_blue_anim
NAME = +3 Of Mana
TYPE = t_normal
On=@dclick
   IF (<SRC.INT> > 99)
      SRC.SYSMESSAGE You spit the potion out in disgust... this potion is for babies!
      RETURN 1
   ENDIF
   src.modint + = 3
   src.anim 17
   src.sound snd_spell_gate_travel
   REMOVE
(This post was last modified: 09-08-2012 03:32 AM by RanXerox.)
09-08-2012 03:31 AM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Can anyone help create this function?
RanXerox, Thanks ....
09-08-2012 03:35 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: #4
RE: Can anyone help create this function?
I am not sure if you realize, the code in this potion gives the person who drinks it a permanent +3 increase in intelligence... and while it is true that does also come with more mana, its not like it will ever "wear off".

On another topic...

If you intended to just modify mana (the by-product of intelligence) and not intelligence itself, that is possible too. However, since there is no "built-in" function for modifying mana (or hitpoints which are the by-product of strength or stamina which is the by-product of dexterity), you might want to use these functions (I left some logging entries in the script that are commented out so you can uncomment them and see how the functions work):

Code:
[FUNCTION MODMAXHITS]
LOCAL.Results=<EVAL <ARGS>>
IF (<ISEMPTY <ARGS>>)
//   SERV.LOG MODMAXHITS returns <dTAG0.MODMAXHITS> for <NAME>.
   RETURN <EVAL <TAG0.MODMAXHITS>>
ELSE
//   SERV.LOG MODMAXHITS changed from <dTAG0.MODMAXHITS> by <dLOCAL.Results> for <NAME> (<UID>).
   TAG.MODMAXHITS=<EVAL <TAG0.MODMAXHITS>+<LOCAL.Results>>
//   SERV.LOG - MAXHITS was <MAXHITS>
   IF !(<TAG0.MODMAXHITS>)
      TAG.MODMAXHITS=
      MAXHITS=
   ELSE
      MAXHITS=<EVAL <MAXHITS>+<LOCAL.Results>>
   ENDIF
//   SERV.LOG - MAXHITS is now <MAXHITS>
ENDIF

[FUNCTION MODMAXSTAM]
LOCAL.Results=<EVAL <ARGS>>
IF (<ISEMPTY <ARGS>>)
//   SERV.LOG MODMAXSTAM returns <dTAG0.MODMAXSTAM> for <NAME>.
   RETURN <EVAL <TAG0.MODMAXSTAM>>
ELSE
//   SERV.LOG MODMAXSTAM changed from <dTAG0.MODMAXSTAM> by <dLOCAL.Results> for <NAME> (<UID>).
   TAG.MODMAXSTAM=<EVAL <TAG0.MODMAXSTAM>+<LOCAL.Results>>
//   SERV.LOG - MAXSTAM was <MAXSTAM>
   IF !(<TAG0.MODMAXSTAM>)
      TAG.MODMAXSTAM=
      MAXSTAM=
   ELSE
      MAXSTAM=<EVAL <MAXSTAM>+<LOCAL.Results>>
   ENDIF
//   SERV.LOG - MAXSTAM is now <MAXSTAM>
ENDIF

[FUNCTION MODMAXMANA]
LOCAL.Results=<EVAL <ARGS>>
IF (<ISEMPTY <ARGS>>)
//   SERV.LOG MODMAXMANA returns <dTAG0.MODMAXMANA> for <NAME>.
   RETURN <EVAL <TAG0.MODMAXMANA>>
ELSE
//   SERV.LOG MODMAXMANA changed from <dTAG0.MODMAXMANA> by <dLOCAL.Results> for <NAME> (<UID>).
   TAG.MODMAXMANA=<EVAL <TAG0.MODMAXMANA>+<LOCAL.Results>>
//   SERV.LOG - MAXMANA was <MAXMANA>
   IF !(<TAG0.MODMAXMANA>)
      TAG.MODMAXMANA=
      MAXMANA=
   ELSE
      MAXMANA=<EVAL <MAXMANA>+<LOCAL.Results>>
   ENDIF
//   SERV.LOG - MAXMANA is now <MAXMANA>
ENDIF

If you want to try it out, change SRC.MODINT +=3 to SRC.MODMAXMANA += 3
09-08-2012 04:16 AM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #5
RE: Can anyone help create this function?
After using the first pot. I can no longer use
(This post was last modified: 09-08-2012 06:37 AM by victorstelzer.)
09-08-2012 06:37 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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