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
Request for a gump to show cooldown of a skill
Author Message
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #1
Request for a gump to show cooldown of a skill
Hi there all!

I've created a system where some characters have unique abilities they can use, which creates an item that has a timer on it that prevents the ability from working (the item is invisible and on the person).

The ability works perfectly, but i don't have a method of showing the current Cool-down time remaining on the ability. anyone know how I can go about it? I would guess a gump but i wouldn't know how to check the timer of an item in your backpack.

///Human Active - Restore///

///This Active ability was deemed too powerful and thus removed
IF <SRC.RESTEST 1 i_timer_ua_human>
SRC.SYSMESSAGE You must wait until your skill becomes active again.
RETURN 1
ELSE
IF (<tag0.race>==1)
SRC.HITS=(<SRC.HITS>+(<SRC.MAXHITS>/2))
SRC.STAM=(<SRC.STAM>+(<SRC.MAXSTAM>/2))
SRC.MANA=(<SRC.MANA>+(<SRC.MAXMANA>/2))
MHC
MMC
MSC
SRC.NEWITEM=i_timer_UA_Human
SRC.ACT.EQUIP
SRC.SOUND 491
effect=3,i_fx_sparkle,6,15,1
RETURN 0
ENDIF

[function MHC]
IF (<SRC.HITS> > <SRC.MAXHITS>)
SRC.HITS=<SRC.MAXHITS>
RETURN 0
ENDIF

[function MMC]
IF (<SRC.MANA> > <SRC.MAXMANA>)
SRC.MANA=<SRC.MAXMANA>
RETURN 0
ENDIF

[function MSC]
IF (<SRC.STAM> > <SRC.MAXSTAM>)
SRC.STAM=<SRC.MAXSTAM>
RETURN 0
ENDIF

[ITEMDEF i_timer_UA_human]
NAME=Delay Teleport
ID=i_handr_1
TYPE=T_EQ_SCRIPT

ON=@Create
ATTR=attr_invis|attr_decay
MORE1=24

ON=@Equip
TIMER=1

ON=@Timer
// Take the effect we would like.
if ( <CONT> )
if ( <MORE1> )
MORE1 -= 1
TIMER=1
return 1
else
CONT.SYSMESSAGE Your Refresh ability is ready
CONT.TAG.UA1=
SOUND=1450
remove
endif
endif
// normal timer fall through is to delete the item
remove
return 1
(This post was last modified: 10-22-2014 05:36 AM by UltimaAku.)
10-22-2014 05:35 AM
Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #2
RE: Request for a gump to show cooldown of a skill
I would use a tag to store the timer's uid and then use it to recover timer's more1

Code:
...
MHC
MMC
MSC
SRC.NEWITEM=i_timer_UA_Human
SRC.TAG.UA1UID=<NEW.UID>
...

Then add the following to clear the tag

Code:
...
CONT.SYSMESSAGE Your Refresh ability is ready
CONT.TAG.UA1=
CONT.TAG.UA1UID=
...

So now in your gump you can show the timer using <UID.<SRC.TAG.UA1UID>.MORE1>
10-22-2014 07:14 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #3
RE: Request for a gump to show cooldown of a skill
you can use FINDID to get some info about the item

Code:
IF (<SRC.FINDID.i_timer_ua_human>)
  SRC.SYSMESSAGE You already using the skill <SRC.FINDID.i_timer_ua_human.TAG.EffectName> and must wait until it becomes active again.
  return 1
ELIF (<TAG0.Race>==1)
  SRC.HITS = <eval <SRC.HITS>+(<SRC.MAXHITS>/2)>
  SRC.STAM = <eval<SRC.STAM>+(<SRC.MAXSTAM>/2)>
  SRC.MANA = <eval <SRC.MANA>+(<SRC.MAXMANA>/2)>
  MHC
  MMC
  MSC
  SERV.NEWITEM=i_timer_UA_Human
  NEW.TAG.EffectName=TEST       // <-- here you set the effect name, or you can set it individually on others functions using FINDID.i_timer_UA_Human.TAG.EffectName=Something
  NEW.EQUIP
  SOUND 491
  EFFECT 3,i_fx_sparkle,6,15,1
  return 0
ENDIF
10-22-2014 10:18 AM
Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #4
RE: Request for a gump to show cooldown of a skill
As i read Coruja's post i remembered that a script like this was used as an example on the wiki's Occam's Razor section
10-22-2014 05:30 PM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #5
RE: Request for a gump to show cooldown of a skill
Artyk, Brilliant, i'll try it out and let you know if it works
10-23-2014 12:41 AM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #6
RE: Request for a gump to show cooldown of a skill
Didn't work... however, i did make a change which did. Now for the part i don't know. How can I make it so the gump has a countdown on it? It's a permanent gump but i want a countdown to appear on the second gumppic (i know the locations wrong for the text, just getting the function to work first)

[DIALOG DRACONIAN_PA]
200,200
noclose
resizepic 0 0 9250 251 100
dtext 21 18 455 Passive - Tough Scales
dtext 149 18 455 Active - Blood Boil
dtext 149 25 455 <EVAL <SRC.TAG.COOLDOWN>>
gumppic 41 39 2253
gumppic 169 39 2295

the countdown number is SRC.TAG.COOLDOWN, but the gump doesn't change unless i re-open the dialog.
(This post was last modified: 10-23-2014 01:59 AM by UltimaAku.)
10-23-2014 01:58 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #7
RE: Request for a gump to show cooldown of a skill
you can call dialog when timer change?
10-23-2014 02:28 AM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #8
RE: Request for a gump to show cooldown of a skill
problem with that is, my gump appears and stays with the player on login, so it's always there. re-opening the dialog would move it back to it's origional location (200,200)
10-23-2014 02:34 AM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #9
RE: Request for a gump to show cooldown of a skill
UPDATE:

I decided to make the gump static, and gone with azmanomer's idea. Problem is, the dialog will not open or close when put in the timer of the item

[ITEMDEF i_timer_UA_draco1]
NAME=Delay Teleport
ID=i_handr_1
TYPE=T_EQ_SCRIPT

ON=@Create
ATTR=attr_invis|attr_decay
MORE1=22
SRC.TAG.COOLDOWN=<MORE1>

ON=@Equip
TIMER=1

ON=@Timer
// Take the effect we would like.
if ( <CONT> )
if ( <MORE1> )
MORE1 -= 1
CONT.TAG.COOLDOWN -= 1
TIMER=1
CONT.DIALOGCLOSE DRACONIAN_PA
CONT.DIALOG DRACONIAN_PA
return 1
else
CONT.SYSMESSAGE Your Blood Boil ability is ready
CONT.TAG.UA1=
SOUND=1450
remove
endif
endif
// normal timer fall through is to delete the item
remove
return 1
10-25-2014 05:06 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #10
RE: Request for a gump to show cooldown of a skill
i can work that just like this otherwise it wont open dialog i dont know why Confused

[function haha]
dialogclose d_status
dialog d_status

[ITEMDEF i_timer_UA_draco1]
NAME=Delay Teleport
ID=i_handr_1
TYPE=T_EQ_SCRIPT

ON=@Create
ATTR=attr_invis|attr_decay
MORE1=22
SRC.TAG.COOLDOWN=<MORE1>

ON=@Timer
// Take the effect we would like.
//if ( <CONT> )
say <cont> <src>
if ( <MORE1> > 0 )
MORE1 -= 1
CONT.TAG.COOLDOWN -= 1
TIMER=1
CONT.timerf 0 haha
return 1
else
CONT.SYSMESSAGE Your Blood Boil ability is ready
CONT.TAG.UA1=
SOUND=1450
remove
endif
10-25-2014 07:10 AM
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)