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, 07:54 PM
Post #2


The Tactician
Group Icon

Distinguished Developer
Posts: 7794
Joined: 1-December 05




If I understood you correctly, what you have done so far is this:

1- You have a spell (say, spell1) which if cast by anyone will set the global variable PCOnly to 1.

2- Then you have written a script to make sure that if the global is set to one and if it is set to 1 because player 1 (and noone else) has cast spell1, then your player one will also cast spell2 on himself. (spell2 = MyPCOnlyspell)

Right?

If so, then it is natural that it has not worked. The way to solve the problem is easy:

Spell1 doesn't need to set any variable. It doesn't need to do anything at all. Just Extend Baldur.bcs and Baldur25.bcs so that whenever Player1 casts spell1, the spell2 is applied to him while whenever any other charcter casts spell1 the message you want be displayed (The only additional work here is that you need to add spell1 to spell.ids)

CODE
  

IF
    Class(Player1,MAGE_ALL)
    SpellCast(Player1,Spell1) // You need to have spell1 in your spell.ids
    RESPONSE #100
        ActionOverride(Player1,ReallyForceSpellRES("MyPConlyspell",Myself))  //

END



IF
    SpellCast(Player2,Spell1)
    RESPONSE #100
        ActionOverride(Player2,DisplayeString(Myself,~Only the protagonist can cast this spell~)) //

END

IF
    SpellCast(Player3,Spell1)
    RESPONSE #100
        ActionOverride(Player2,DisplayeString(Myself,~Only the protagonist can cast this spell~)) //

END

IF
    SpellCast(Player4,Spell1)
    RESPONSE #100
        ActionOverride(Player2,DisplayeString(Myself,~Only the protagonist can cast this spell~)) //

END

IF
    SpellCast(Player5,Spell1)
    RESPONSE #100
        ActionOverride(Player2,DisplayeString(Myself,~Only the protagonist can cast this spell~)) //

END

IF
    SpellCast(Player6,Spell1)
    RESPONSE #100
        ActionOverride(Player2,DisplayeString(Myself,~Only the protagonist can cast this spell~)) //

END



Also, If the spell's (spell2's) effects do not depend on the caster's level of experience, you can use ApplySpellRES (instead of ReallyForceSpellRES)



--------------------
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: 13th May 2026 - 04:04 AM