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
putting cooldown on scrolls
Author Message
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #21
RE: putting cooldown on scrolls
Code:
on=@SpellCast
if (<argo.type> == t_spellbook) // Make sure the spell is being cast from a spellbook,
if (<argn1> == 0||25||26||30) // Spell numbers which your script omitted, which led me to believe you didn't want them used
smsg You do not know how that magic works.
return 1
endif
endif

Code:
if (<argo.type> == t_scroll) // checks to be sure a scroll is being used.
if (<findlayer.layer_memory.baseid> == i_memory_scroll_cooldown) // check for cooldown memory (This section parses if there is one)
  src.smsg You cannot use a scroll again til <findlayer.layer_memory.baseid.i_memory_scroll_cooldown.timer> seconds.
  return 1
endif
if (<argn1> == s_flamestrike||s_fireball) // sample spells you asked for to provide a cooldown
  serv.newitem i_memory_scroll_cooldown,,<uid> // adds a cooldown
  new.timer = 5 // timer of cooldown
endif
if (<argn1> == s_poison) // other test spell from scroll.
  serv.newitem i_memory_scroll_cooldown,,<uid> // adds cooldown
  new.timer = 7 // timer of cool down
endif
endif

What errors are you getting? And do you have anything else affecting @SpellCast in another script. Just the original you had @SpellCast trigger twice in ONE script.
02-19-2016 09:39 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: #22
RE: putting cooldown on scrolls
on=@SpellCast
if (<argo.type> == t_spellbook) // Make sure the spell is being cast from a spellbook,
if (<argn1> == 0||25||26||30) // Spell numbers which your script omitted, which led me to believe you didn't want them used
smsg You do not know how that magic works.
return 1
endif
endif

The left out spells was a mistake on my part Arch Mage is supposed to be abel to cast all spells so i might not even need the spell restrictions at all Confused.

Anyway im getting this error in the console when i use the scroll in question

01:07:ERROR:(sphere_skills.scp,1651)Undefined symbol 'layer_memory'

if you would like we have a dropbox and a github which you could check out if there is something you want to make sure im not fucking up?

and im sorry for my newbie questions just picked up sphere again after 12 years away from Ultima Online so all my old knowledge is pretty much gone.
02-19-2016 10:10 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #23
RE: putting cooldown on scrolls
Code:
[SKILLCLASS 23]

DEFNAME=Class_human_arch_mage
NAME=Arch Mage
//EVENTS=e_human_arch_mage
STATSUM=260
SKILLSUM=10000.0
STR=70
INT=95
DEX=90
Alchemy=100.0
Anatomy=100.0
AnimalLore=100.0
ItemId=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=100.0
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteId=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=100.0
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0
Focus=100.0
Chivalry=100.0
Bushido=100.0
Ninjitsu=100.0
Spellweaving=100.0
Mysticism=100.0
Imbuing=100.0
Throwing=100.0

ON=@ItemEquipTest
if (<act.tdata3> == 1||3||4||5)
src.smsg You can't equip this armor.
return 1
endif

on=@SpellCast
if (<argo.type> == t_scroll)
if (<findlayer.layer_special.baseid> == i_memory_scroll_cooldown)
  src.smsg You cannot use a scroll again til <findlayer.layer_special.baseid.i_memory_scroll_cooldown.timer> seconds.
  return 1
endif
if (<argn1> == s_flamestrike||s_fireball)
  serv.newitem i_memory_scroll_cooldown,,<uid>
  new.timer = 5
endif
if (<argn1> == s_poison)
  serv.newitem i_memory_scroll_cooldown,,<uid>
  new.timer = 7
endif
endif

Code:
[ITEMDEF i_memory_scroll_cooldown]
ID=i_memory
TYPE=t_eq_script
NAME=Memory scroll cooldown

ON=@Timer
REMOVE
RETURN 1

There! That was actually MY mistake. I have a backwards compat for layer_memory. It made more sense to call it that than layer_special in my own code. ^_^ Took out your restrictions.
(This post was last modified: 02-19-2016 01:03 PM by Khaos.)
02-19-2016 11:35 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: #24
RE: putting cooldown on scrolls
Thanks thee great one, i will test this script. My humble servants and I also posted this link in the description i send thy
http://forum.spherecommunity.net/Thread-...a-scripter

Hmm its still not working and now im not getting errors in the console anymore.
(This post was last modified: 02-19-2016 12:16 PM by dunnetott.)
02-19-2016 12:06 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #25
RE: putting cooldown on scrolls
Well, I hope this works this time, as it should. It was just you don't have my spheredefs.scp file with all of my personal changes. Again, very sorry that happened!!! ^_^ Need to keep in mind sphere isn't set up as logical as I try to make things at times in the base packs.

Hehee. Aww, thanks for sharing that link, but playing is not my thing. Just programming and designing it all. ^_^ Used to play a long time ago, but once you get into this end as deep as some of us are... The joys in playing seem to be lost. At least for myself that is.
02-19-2016 12:20 PM
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: #26
RE: putting cooldown on scrolls
well, we are searching for help that you seem to provide with excellence , if you want to help you can ^_^ we really appreciate the help anyhow , just for scripting if you want.

Well at the moment the console are not outputting any errors when i cast the scroll now atleast but im still not receiving any coold down on it. Confused
02-19-2016 12:29 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #27
RE: putting cooldown on scrolls
The cool down is only 5 and 7 on those scrolls if I remember right, make them a bit longer and test, as the casting time might be close to those time spans. Smile

If there are no errors, it should be working right now.

Another option is to take the @SpellCast code and remove it. Then make this:

Code:
[typedef t_scroll]
on=@DClick
if (<src.findlayer.layer_special.baseid> == i_memory_scroll_cooldown)
  src.smsg You cannot use a scroll again til <src.findlayer.layer_special.baseid.i_memory_scroll_cooldown.timer> seconds.
  return 1
endif
if (<morex> == s_flamestrike||s_fireball)
  serv.newitem i_memory_scroll_cooldown,,<src.uid>
  new.timer = 5
endif
if (<morex> == s_poison)
  serv.newitem i_memory_scroll_cooldown,,<src.uid>
  new.timer = 7
endif

Edited the top code as well. I forgot to switch a layer_memory to layer_special

Try the code I posted before this with the new edit and change the timers to new.timer = 7 and new.timer = 7 to new.timer = 12.

If that doesn't work. Let me know.

Also, you could try this recent code and remove everything in @SpellCast

Do you have anything else in your scripts using @SpellCast?! If so, you might want to move all of the code into the main @SpellCast on the skillclass, just be sure to remove any extra @SpellCast triggers when you do so.
(This post was last modified: 02-19-2016 01:08 PM by Khaos.)
02-19-2016 01:01 PM
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: #28
RE: putting cooldown on scrolls
the only place in the code where on=@spellcast is used is under other skillclasses that shouldent be a problem right since its diffrent codes? or am i wrong about that?

yeah we put the time on 30 yesterday when you replied to see if that was the issue still no cooldown or errors tho.

im going to try the new code and see if that method works.


nothing works tried everything you told me and there still are no cooldown
am i doing something horrible wrong?
tested so everything loads into the server and i can spwn the memory scroll so that should be there.
the skillclass im using is correct, tested with the equipment restriction to make sure i was in right skillclass.
restarted the server a few times.
tried going out of .gm and .invul tried make a pure player character.
tried to manualy craft the scroll in game instead of spawning it in.

There are no errors in the console either not when the server is booting or when the scroll is being used.

This is all code i have revolving the scroll cooldown
(I commented out the scrollcooldown script under skillclass to test the new code you provided.) still no cooldown either.

and this is the spell script

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

here is a link to our github: https://github.com/FiveEYZ/SphereShadowRealm
(This post was last modified: 02-19-2016 11:56 PM by dunnetott.)
02-19-2016 08:58 PM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #29
RE: putting cooldown on scrolls
Set the server into debug mode and grab me the information from that when you attempt to try this. By the looks of things, it should be working. Going to go into your github and take a look and see if I can find anything else calling @SpellCast. Because it feels like something else is overwriting the trigger, especially if you are not getting any errors in casting, triggers, or memory item creation. The code is no different than what anyone else has tried giving you, just a bit cleaner.

Try this as well

Code:
[typedef t_scroll]
on=@DClick
if (<src.findlayer.layer_special.baseid> == i_memory_scroll_cooldown)
  src.smsg You cannot use a scroll again til <src.findlayer.layer_special.baseid.i_memory_scroll_cooldown.timer> seconds.
  return 1
endif
if (<morex> == 57) // We are going to try to pull the spell from the # itself to make sure defname isn't being bypassed.
  serv.newitem i_memory_scroll_cooldown,,<src.uid>
  new.timer = 30
endif

Also, when you dclick the scroll. Use .EDIT and target whoever is doing it. Look for the memory item of i_memory_scroll_cooldown and make sure it is getting added to the character using the scroll. Then double check the timer.

shadowrealmdefs.scp

Not sure how you can test anything when you have the entire t_scroll section of code commented out. That would be a huge reason it won't work.

Also, you don't need to comment out all those lines when you want to temp remove something. Just change [typedef t_scroll] to [comment typedef t_scroll]
(This post was last modified: 02-20-2016 01:59 PM by Khaos.)
02-20-2016 01:42 PM
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: #30
RE: putting cooldown on scrolls
I commentet out t_scroll to try something else that didnt work either Tongue
just did owerwrite the old t_scroll with the one you provided now and did cast flame strike with the scroll did edit didnt see memory scroll(moused over the menu since it has no icon) nothing i did just dclick the scroll and .edit still nothing

yeah we are not getting any errors in the console at all so i figure it would work to and ive been looking through the code but have seen any @spellcast that would interfere with that code.

i can add the memory scroll manually in the game so that script is loaded.
(This post was last modified: 02-20-2016 10:44 PM by dunnetott.)
02-20-2016 10:42 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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