Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
putting cooldown on scrolls
Author Message
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #1
putting cooldown on scrolls
i have made a duplica of my flame strike spell like this

Code:
[Spell 51]
DEFNAME=s_flamestrike
NAME=Flame Strike
SOUND=snd_SPELL_FLAMESTRIKE
RUNES=KVF
CAST_TIME=40
RESOURCES=i_reag_spider_silk,i_reag_sulfur_ash
RUNE_ITEM=i_rune_FLAMESTRIKE
SCROLL_ITEM=i_scroll_FLAMESTRIKE
FLAGS=SPELLFLAG_TARG_OBJ|SPELLFLAG_HARM|SPELLFLAG_FX_TARG|SPELLFLAG_RESIST|SPELL​FLAG_DAMAGE
EFFECT_ID=03709
EFFECT=25,50
DURATION=0.0
MANAUSE=40
SKILLREQ=MAGERY 70.0
INTERRUPT=0.0,0.0

[Spell 510]
DEFNAME=s_flamestrike_scroll
NAME=Flame Strike
SOUND=snd_SPELL_FLAMESTRIKE
RUNES=KVF
CAST_TIME=20
RESOURCES=i_reag_spider_silk,i_reag_sulfur_ash
RUNE_ITEM=i_rune_FLAMESTRIKE
SCROLL_ITEM=i_scroll_FLAMESTRIKE
FLAGS=SPELLFLAG_TARG_OBJ|SPELLFLAG_HARM|SPELLFLAG_FX_TARG|SPELLFLAG_RESIST|SPELL​FLAG_DAMAGE
EFFECT_ID=03709
EFFECT=25,50
DURATION=0.0
MANAUSE=0
SKILLREQ=MAGERY 70.0
INTERRUPT=0.0,0.0

and then i made so the scroll trigger the spell s_flamestrike_scroll that has half the cast time of the original spell cast from the spellbook but i want to add a cooldown for scroll so you cant spam the scrolls.
is there away to do that?
ive been looking through the potions scripts looking for a COOLDOWN= something but didnt find anything there.

also for some reason my potions wont stack like greater healing potion.
02-18-2016 01:37 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #2
RE: putting cooldown on scrolls
Instead of creating a new spell each time, you can create an event and use @SpellSelect:

Code:
ON=@SpellSelect
IF (<ARGO.TYPE>==t_scroll)
ARGN2 /= 2 //50% mana
ENDIF

When you drink a potion, a memory is created and placed in the layer_flag_potionused. If you already have the memory, you can't drink. The memory has a TIMER, when it reaches 0 the memory is removed and you can drink again. Potions won't stack probably because they have not the correct flag in tiledata.mul. Be ware that if you stack the potions, the MORE2 (potency of the spell casted) will change (it will be the mean value of the MORE2 of the two items?)

If you want to set the cooldown for every scroll regardless to the spell casted you can do this:
Code:
[ITEMDEF i_memory_scroll_cooldown]
ID=i_memory
TYPE=t_eq_script
NAME=Memory scroll cooldown

ON=@Timer
REMOVE
RETURN 1

[TYPEDEF t_scroll]
IF (<SRC.RESTEST 1 i_memory_scroll_cooldown>)
SRC.SYSMESSAGE You can't use a scroll yet!
RETURN 1
ENDIF
SERV.NEWITEM i_memory_scroll_cooldown,1,<SRC.UID>
NEW.TIMER = 5 //your cooldown
02-18-2016 01:57 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes karma's post
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #3
RE: putting cooldown on scrolls
[ITEMDEF i_memory_scroll_cooldown]
ID=i_memory
TYPE=t_eq_script <- isnt this messing up the function to put the scroll in a spellbook?
NAME=Memory scroll cooldown
02-18-2016 02:04 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #4
RE: putting cooldown on scrolls
No because i_memory_scroll_cooldown is a new item and it is checked only when you are dclicking (so, using in order to cast a spell) the scroll.
t_eq_script is a type you need in order to equip this item on the char in his layer_special, which contains memories and can contain multiple of them.
02-18-2016 02:11 AM
Find all posts by this user Like Post Quote this message in a reply
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #5
RE: putting cooldown on scrolls
but if i want the default scrolls to have a cooldown and be able to be put into the spell book i can still use this method?
02-18-2016 02:14 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #6
RE: putting cooldown on scrolls
Sure, because in order to add the scroll to the spellbook you drop the scroll on the spellbook, so @DClick trigger won't run. If you use that script, you affect all the scrolls, since you insert the code in the t_scroll type.
02-18-2016 02:24 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes karma's post
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #7
RE: putting cooldown on scrolls
hmm been serching thru my github thru all my scripts cant find where [TYPEDEF t_scroll] is is it hard coded?
02-18-2016 02:42 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #8
RE: putting cooldown on scrolls
Yes but you can simply add a [TYPEDEF t_scroll] to add custom behaviour to the hardcoded one.
02-18-2016 03:02 AM
Find all posts by this user Like Post Quote this message in a reply
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #9
RE: putting cooldown on scrolls
t_eq_script where did you get this from is that a custom type i have to do?

and Thanks for all the help ^^
(This post was last modified: 02-18-2016 03:03 AM by dunnetott.)
02-18-2016 03:03 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #10
RE: putting cooldown on scrolls
No it's an hardcoded type, you can use it directly.
02-18-2016 03:27 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)