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
Meditation while fighting
Author Message
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #1
Meditation while fighting
Cannot seem to allow meditation when fighting, says you are too preoccupied. My flags for my meditation skill are "SKF_SCRIPTED" and this still occurs. I've also tried using "SKF_FIGHT" but it does nothing. Any ideas?
01-17-2017 10:36 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Meditation while fighting
In last nightly sphere build (don't know/remember in previous builds) meditation actually starts even if you are in combat (i think it's a bug).

Example:
Enter War Mode
Start Meditation: the message "You attempt a meditative trance" will appear.
If Meditation is successfull you get no success message but instead the mana will start to rise, if you fail you get the "You lost concentration" message.
Try again to start meditation, you will get the "You are preoccupied with thoughts of battle" message.


Note:
When you succeed in meditation, the @success trigger is called until you cancel the Meditation action by using another skill or entering/leaving combat mode.

Note 2:
By applying the SKF_SCRIPTED flag the note above doesn't apply, remember to restart Sphere when you change a SKILL/SPELL flag.

Example:
Code:
[SKILL 46]
DEFNAME=Skill_Meditation
KEY=Meditation
TITLE=Stoic
FLAGS = SKF_SCRIPTED //Remember to restart Sphere after applying/removing a SKILL/SPELL flag
DELAY=2.0,1.0
STAT_STR=10
STAT_DEX=10
STAT_INT=100
BONUS_STR=5
BONUS_DEX=90
BONUS_INT=5
BONUS_STATS=20
ADV_RATE=10.0,200.0,800.0

ON=@Select
//serv.log  Selected meditation
//This should prevent you are in combat message when meditating.
if <ISTIMERF.f_resetMeditation>
      sysmessage @70 You are already Meditating.
      return 1
endif
ON=@Fail
    //SRC.f_meditation_setup
    SRC.SYSMESSAGE You lose your concentration.

ON=@Abort
    //SRC.f_meditation_setup
    SRC.SYSMESSAGE You stop concentrating.
    TIMERF STOP,f_resetMeditation
ON=@Start
    //SRC.f_meditation_setup
    sysmessage @70 You start Meditating.
    //Skill Check here
    
ON=@Success
    //SRC.f_meditation_setup
    
    sysmessage @70 You enter in a meditative trance.
    regenMana += 5
    regenValMana += 10
    serv.log <regenMana> / <regenValMana>
    timerf 20, f_resetMeditation
    
[FUNCTION f_resetMeditation]
regenMana -= 5
regenValMana -= 10
sysmessage @70 You leave the meditative trance.

Anyway, in the script above a lot of checks are missing, so it's just for giving you an idea.
(This post was last modified: 01-17-2017 11:43 PM by darksun84.)
01-17-2017 10:22 PM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #3
RE: Meditation while fighting
I tried adding what you suggested and it seems to only work when the player is not "too preoccupied" (not in combat). What is the flag for combat? If I add a check for combat on @select shouldn't that work? I just don't know what to put into the if statement for combat.
01-18-2017 04:32 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Meditation while fighting
try in

Code:
ON=@Select
//if <ISTIMERF.f_resetMeditation>
//sysmessage @70 You are already Meditating.
    if <flags>&statf_war
        sysmessage @70 You are meditating in combat.
        return 1
    endif
01-18-2017 04:43 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #5
RE: Meditation while fighting
That would only work if the player is in war mode, when the player is in "combat mode" there is a whole other check somewhere that I cannot find.

What you gave me works when you are in war mode, but as soon as you double click anything to attack, this no longer works and it gives the message "You are preoccupied with thoughts of battle". Is there no way to check if a player is fighting something besides checking for war mode?
01-18-2017 04:49 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Meditation while fighting
Ah i understand, yes looks like you can't meditate during an active fight, but i don't think it's modifiable by scripts.
01-18-2017 05:28 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #7
RE: Meditation while fighting
There has to be a way.. is there no way to check if a player is attacking something?
01-18-2017 08:16 AM
Find all posts by this user Like Post Quote this message in a reply
zottolo
Journeyman
*

Posts: 87
Likes Given: 8
Likes Received: 12 in 11 posts
Joined: Dec 2015
Reputation: 0



Post: #8
RE: Meditation while fighting
(01-18-2017 08:16 AM)Leonidas Wrote:  There has to be a way.. is there no way to check if a player is attacking something?

sorry about my question but, can i ask you why don't you simply create a new meditation sys unbounded from any char behaviour?
01-18-2017 03:55 PM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #9
RE: Meditation while fighting
I would love to do that, but I've never been able to figure out how I would make it so the "Useskill>meditation" macro would use my new system.
01-18-2017 04:50 PM
Find all posts by this user Like Post Quote this message in a reply
zottolo
Journeyman
*

Posts: 87
Likes Given: 8
Likes Received: 12 in 11 posts
Joined: Dec 2015
Reputation: 0



Post: #10
RE: Meditation while fighting
(01-18-2017 04:50 PM)Leonidas Wrote:  I would love to do that, but I've never been able to figure out how I would make it so the "Useskill>meditation" macro would use my new system.

ok, maybe i don't have enough experience for that but if you want this skill to work anywhere, anytime and anyhow you can simply add @select a new memory that delivers a certain amount of mana every second and returning 1 the trigger to block the normal meditation use, something like this:

my only concern is that is looking a little bit "heavy" but could be a good base to work on to, from now on you can handle all skill levels, skillgain, skillwait delay and block cases adding an event
(This post was last modified: 01-19-2017 06:03 PM by zottolo.)
01-19-2017 05:47 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)