The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

> Protagonist Spell Only
Rabain
post Mar 8 2007, 04:56 PM
Post #1


GOD


Retired team member
Posts: 1728
Joined: 14-July 04
From: Ireland




I want to create a spell that only the protagonist can cast. If anyone else tries to cast it they will get a message.

So far I have tried casting a spell that sets a global. In a script if have the following:

CODE
IF
    Global("PConly","GLOBAL",1)
    Class(Player1,MAGE_ALL)
    IsActive(Player1)
THEN
    RESPONSE #100
        ActionOverride(Player1,ForceSpellRES("MyPConlyspell",Myself))         ActionOverride(Player1,DisplayStringHead(Myself,8538))
        SetGlobal("PConly","GLOBAL",2)
END


Ignore the DisplayStringHead..thats just for testing.

What is happening is that even if someone else in the party casts the first spell my Player1 starts casting "MyPConlySpell"

I can't seem to find a valid script command that specifies PC only.

I will also need a command that will work if someone not the PC casts the spell. I can use this in a second script block.
Go to the top of the page
 
Quote Post
 
Start new topic
Replies
Sikret
post Mar 8 2007, 11:42 PM
Post #2


The Tactician
Group Icon

Distinguished Developer
Posts: 7794
Joined: 1-December 05




spell1 sets the global to one in the same round that script needs it to be 1. So when checking the trigger the global is not 1 yet. You can divide the script to two distinct blocks for player 1. In the first one if player 1 has cast the spell the global will be set to one. In the second block, if the global is set to one, spell2 will be apllied to player 1. Still, spell1 should do nothing. The global will be set in the script (first block) only if spell1 is cast by player1.

CODE
  

IF
    Global("WTPFAMA1","GLOBAL",0)
    Class(Player1,LONG_BOW)
    SpellCast(Player1,MY_SPELL)
THEN
    RESPONSE #100
        SetGlobal("WTPFAMA1","GLOBAL",1)
END

IF
    Global("WTPFAMA1","GLOBAL",1)
THEN
    RESPONSE #100
        SetGlobal("WTPFAMA1","GLOBAL",2)
        ActionOverride(Player1,ApplySpellRES("WTPFAMA1",Myself))
END





--------------------
Improved Anvil




Cheating is not confined to using external software or the console commands. Abusing the flaws and limitations of the game engine to do something that a human Dungeon Master would not accept or allow is cheating.
Go to the top of the page
 
Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 17th February 2026 - 01:53 AM