Magic shield from Act 2
Hey guys!
I wanted to use a shield against undead warriors (shield is used by Detmold\Filippa in the original game). I found out that you need to add a special item to a NPCs character and after that shield will appear. It does work: shield appeared but it doesn't affect monsters. I looked for a script of shield-item and I found it in q201_magic_shield.ws
Here is a piece I'm interested in:
But in the game if works only if player character is out of shield (he takes damage like in the original game) and in the shield (he doesn't take damage from not being outside the shield area). If someone else passes through the shield, nothing happens.
My first guess was that the monster-condition is wrond, but here what we have:
it must have "monster" tag (done, cause all the monsters have that tag) and something should be enabled. As long as conditions for player work fine and there we have "enable"-condition too, I am pretty sure that "something" is enabled.
So what can be a reason for none-reacting on monsters?
As a shield carrier I use q201_detmold_guide entity template (the same that is used in the original game). Monsters are spawned via Entity Spawner.
Hey guys!
I wanted to use a shield against undead warriors (shield is used by Detmold\Filippa in the original game). I found out that you need to add a special item to a NPCs character and after that shield will appear. It does work: shield appeared but it doesn't affect monsters. I looked for a script of shield-item and I found it in q201_magic_shield.ws
Here is a piece I'm interested in:
Code:
event OnInteractionActivated( interactionName : name, activator : CEntity )
{
var actor : CActor;
actor = (CActor)activator;
encounter = (CEncounter) theGame.GetNodeByTag('quest_fog_main_encounter');
if(activator.HasTag('monster') && enable)
{
if (((CActor)activator).GetCharacterStats().HasAbility('q201 lethal dmg ability'))
{
actor.GetCharacterStats().RemoveAbility( 'q201 lethal dmg ability' );
actor.DecreaseHealth(((CActor)activator).initialHealth * 0.7 , true, NULL );
actor.PlayEffect('medalion_detection_fx', actor);
if(FactsQuerySum('owl_stopped') != 1)
{
actor.GetCharacterStats().AddAbility( 'q201 damage on time for monster' );
actor.PlayEffect('magic_shield_hit', actor);
MagicLightning(actor, fogGuide);
}
}
else
{
actor.DecreaseHealth(((CActor)activator).initialHealth * 0.7 , true, NULL );
actor.PlayEffect('medalion_detection_fx',actor);
if(FactsQuerySum('owl_stopped') != 1)
{
actor.GetCharacterStats().AddAbility( 'q201 damage on time for monster' );
actor.PlayEffect('magic_shield_hit', actor);
MagicLightning(actor, fogGuide);
}
}
}
else if(activator == thePlayer && enable)
{
AreaEnvironmentDeactivate("AreaEnvironment_boss_out");
AreaEnvironmentActivate("AreaEnvironment_boss1");
if (thePlayer.GetCharacterStats().HasAbility('q201 damage on time for player'))
{
thePlayer.GetCharacterStats().RemoveAbility( 'q201 damage on time for player' );
}
if(FactsQuerySum('owl_stopped') == 1)
{
encounter.SetEnableState(false);
Log("MAIN FOG ENCOUNTER" + encounter + " IS ENABLED = " + encounter.IsEncounterActive() );
}
}
}
event OnInteractionDeactivated( interactionName : name, activator : CEntity )
{
var actor : CActor;
actor = (CActor)activator;
encounter = (CEncounter) theGame.GetNodeByTag('quest_fog_main_encounter');
if(activator.HasTag('monster')&& enable)
{
//actor.GetCharacterStats().AddAbility( 'q201 lethal dmg ability' );
actor.GetCharacterStats().RemoveAbility( 'q201 damage on time for monster' );
actor.StopEffect('medalion_detection_fx');
actor.StopEffect('magic_shield_hit');
}
else if(activator == thePlayer && enable)
{
thePlayer.GetCharacterStats().AddAbility( 'q201 damage on time for player' );
AreaEnvironmentDeactivate("AreaEnvironment_boss1");
AreaEnvironmentActivate("AreaEnvironment_boss_out");
if(FactsQuerySum('owl_stopped') == 1)
{
encounter.SetEnableState(true);
Log("MAIN FOG ENCOUNTER" + encounter + " IS ENABLED = " + encounter.IsEncounterActive() );
}
}
}
But in the game if works only if player character is out of shield (he takes damage like in the original game) and in the shield (he doesn't take damage from not being outside the shield area). If someone else passes through the shield, nothing happens.
My first guess was that the monster-condition is wrond, but here what we have:
Code:
if(activator.HasTag('monster') && enable)
it must have "monster" tag (done, cause all the monsters have that tag) and something should be enabled. As long as conditions for player work fine and there we have "enable"-condition too, I am pretty sure that "something" is enabled.
So what can be a reason for none-reacting on monsters?
As a shield carrier I use q201_detmold_guide entity template (the same that is used in the original game). Monsters are spawned via Entity Spawner.
Last edited: