![]() |
putting cooldown on scrolls - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: putting cooldown on scrolls (/Thread-putting-cooldown-on-scrolls) |
putting cooldown on scrolls - dunnetott - 02-18-2016 01:37 AM i have made a duplica of my flame strike spell like this Code: [Spell 51] 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. RE: putting cooldown on scrolls - karma - 02-18-2016 01:57 AM Instead of creating a new spell each time, you can create an event and use @SpellSelect: Code: ON=@SpellSelect 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] RE: putting cooldown on scrolls - dunnetott - 02-18-2016 02:04 AM [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 RE: putting cooldown on scrolls - karma - 02-18-2016 02:11 AM 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. RE: putting cooldown on scrolls - dunnetott - 02-18-2016 02:14 AM 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? RE: putting cooldown on scrolls - karma - 02-18-2016 02:24 AM 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. RE: putting cooldown on scrolls - dunnetott - 02-18-2016 02:42 AM hmm been serching thru my github thru all my scripts cant find where [TYPEDEF t_scroll] is is it hard coded? RE: putting cooldown on scrolls - karma - 02-18-2016 03:02 AM Yes but you can simply add a [TYPEDEF t_scroll] to add custom behaviour to the hardcoded one. RE: putting cooldown on scrolls - dunnetott - 02-18-2016 03:03 AM t_eq_script where did you get this from is that a custom type i have to do? and Thanks for all the help ^^ RE: putting cooldown on scrolls - karma - 02-18-2016 03:27 AM No it's an hardcoded type, you can use it directly. |