![]() |
Creatures casting spells - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Creatures casting spells (/Thread-Creatures-casting-spells) |
Creatures casting spells - Samba - 02-05-2014 05:11 AM Hello, I've searched everywhere but I couldn't manage to find anything about making a character cast a spell at will. I'm imagining a "follower" that I can control with words or something like that... Is that possible? Oh, and furthermore: I've an issue. I'm trying to make a copy of myself that dies after some seconds, this is what I did: Code: [function f_createIllusion] I execute this everytime I cast a spell: Code: on=@SpellCast But when I tested it with the spell "teleport", when the server spawn my doppleganger on me, it won't let me teleport to where I said but, instead, it telelports on the same spot where I was when I casted teleport. The code for the c_h_copy: Code: [CHARDEF c_h_copy] Oh, and by the way, is there a way to make the SRC of a @Create someone who's not the server? (UID: 00) RE: Creatures casting spells - darksun84 - 02-05-2014 05:57 AM Looks like that the FOR along with serv.newdupe changes the act value to the uid of the last duped item . The correct value of act should be 0 at end of the teleport spell, but instead i got 0:47:(H_PlayerEvents.scp,17)Final Act value 040001be8 -> backpack Probably serv.newdupe goes mad when used inside a for or it's not used correctly, don't know yet RE: Creatures casting spells - Samba - 02-05-2014 08:25 AM Well forcharlayer doesn't work, for me, so I figured I should use that to cycle through all my equipped items... Have you got any ideas regarding the spell casting npc? RE: Creatures casting spells - XuN - 02-05-2014 09:13 AM Code: [function f_createIllusion] RE: Creatures casting spells - Samba - 02-05-2014 08:22 PM btw, works if i put the act save/restore on the @CastSpell trigger of characters, thanks! Any insights on making the summoned creatures casting spell? I would have to make it cast on enemies the summoner's see hostiles... How do you recognize if someone's your enemy? (enemy because of your guild's war status or by karma or by whatever reason!) Edit: I probably found something, i'm gonna play around with it: spellflag_field Ok... managed to make it cast something, is there a way to see what and how does a brain_ AI system works? RE: Creatures casting spells - darksun84 - 02-05-2014 09:29 PM If i remember well, in the file spherebackwardsomething.scp there is a function named npccast that allows npc to cast all the spells you want RE: Creatures casting spells - XuN - 02-05-2014 11:19 PM You can copy the player's memory's items with a for loop and create a dupe of them in the new character. RE: Creatures casting spells - Samba - 02-05-2014 11:55 PM It works just fine! Thanks darksun & xun Now I only need to make him attack whatever the master sees as hostile! ![]() Code: on=@SpellCast |