Hi All,
I've been trying to display a warning message before attacking a NPC. I checked the appropriate 2da file for the PC and it says that the scripts are gb_comp_heart for the heartbeat script. Im assuming this is were you control the initial combat commands to attack. When I copy the gb_comp_heart and comment out the combat routine. And place it in the overide directory. The PC still attacks and fights the NPC. Anyone know where and how to supress the attack command for the PC. I hoping someone out there has done it.
Thanks,
Calva64
Display a warning message before attacking for the PC
Débuté par
Calva64
, oct. 26 2010 06:38
#1
Posté 26 octobre 2010 - 06:38
#2
Posté 26 octobre 2010 - 09:45
I guess you could use a script in the creature's On Damaged Script property to trap the attack result. The player can then be presented with a warning dialog that gives the choice of either proceeding with the attack (in which case the combat continues) or not (in which case the damage is healed and the NPC is returned to its previous non-hostile state).
Seems like there should be a better approach though.
Seems like there should be a better approach though.
Modifié par rjshae, 26 octobre 2010 - 09:47 .
#3
Posté 26 octobre 2010 - 11:09
The On Physically Attacked and On Spell Cast At script events for the NPC might be what you are wanting to use.
Do something like this (pseudo-script - note this is two scripts squished into one, see comments in script):
void main()
{
object oAttacker = GetLastAttacker(); // For On Attacked
object oCaster = GetLastSpellCaster(); // For On Spell Cast
if(some condition here - such as PC has not yet been warned)
{
// Display Warning Text Here
return;
}
else // PC has already decided to continue attacking
{
ExecuteScript("nw_c2_default5", OBJECT_SELF); // For On Attacked - Execute default script
ExecuteScript("nw_c2_defaultb", OBJECT_SELF); // For On Spell Cast At - Execute default script
}
}
Do something like this (pseudo-script - note this is two scripts squished into one, see comments in script):
void main()
{
object oAttacker = GetLastAttacker(); // For On Attacked
object oCaster = GetLastSpellCaster(); // For On Spell Cast
if(some condition here - such as PC has not yet been warned)
{
// Display Warning Text Here
return;
}
else // PC has already decided to continue attacking
{
ExecuteScript("nw_c2_default5", OBJECT_SELF); // For On Attacked - Execute default script
ExecuteScript("nw_c2_defaultb", OBJECT_SELF); // For On Spell Cast At - Execute default script
}
}
#4
Posté 26 octobre 2010 - 11:50
Thank you for your responses. I guess I need to elaborate a little more I have the display box comming up when he attacks the NPC, but how do I halt the pc attacking action. The box pops up and he continues to attack.
Please Advise
Please Advise
#5
Posté 27 octobre 2010 - 02:48
AssignCommand(oPC, ClearAllActions(TRUE));
That might be somewhere to start...
That might be somewhere to start...





Retour en haut






