Ok I have seen several smith scripts and liked them all, but was having a
hell of a time getting the guy to stop banging his hammer long enough for me to
ask him anything.
so I found a way to make it work.
ok first in the userdefined script put this:
void main()
{
int nUser = GetUserDefinedEventNumber();
switch(nUser)
{
case 100: //bangitman
int random = d20(1);
switch(random)
{
case 1:
ActionSpeakString( "Now dat looks good !");
break;
case 2:
ActionSpeakString( "Make me dis, make me dat!");
break;
case 3:
ActionPlayAnimation( ANIMATION_LOOPING_PAUSE_TIRED);
break;
case 4:
ActionSpeakString( "Now dat looks good !");
break;
case 5:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 6:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 7:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 8:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 9:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 10:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 11:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 12:
ActionAttack( GetObjectByTag( "anvil" ));
break;case 13:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 14:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 15:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 16:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 17:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 18:
ActionAttack( GetObjectByTag( "anvil" ));
break;
case 19:
ActionAttack( GetObjectByTag( "anvil" ));
break;case 20:
ActionAttack( GetObjectByTag( "anvil" ));
break;
}
}
}
0k next in his heartbeatscript put this:
void main()
{
object oPC = GetFirstPC();
if (GetLocalInt (oPC, "smith") == 0)
{
SignalEvent(OBJECT_SELF, EventUserDefined(100));
}
}
now paint a trigger on the floor all around the smith. on the onenter script do
this:
void main()
{
object oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
SetLocalInt(oPC, "smith", 1);
}
}
now on the on exit do this:
void main()
{
object oPC = GetExitingObject();
if (GetIsPC(oPC))
{
SetLocalInt(oPC, "smith", 0);
}
}
this way the guy stops banging long enough to start a merchant or conversation.
Once you are away from his anvil he goes back to the whacking.
good luck it worked great for me
this is an add on enhancement to my working merchant blacksmith i posted a
few pages back. Basically this is for the anvil (or invisible object placed on
the anvil of the city interior smithy ) Make the anvil(or invis object) usable,
flag it for plot, give it a 5 hardness, and give it max hit points.
in the on damaged script put this:
void main()
{
object oTarget = OBJECT_SELF;
effect eVisual = EffectVisualEffect( VFX_COM_BLOOD_SPARK_SMALL );
ApplyEffectTo Object ( DURATION_TYPE_INSTANT , eVisual, oTarget);
}
what this does is add a great spark effect to the anvil every time the smith
hits it (or the PC for that matter, but heh that could be fun for the pc, to
bash on an anvil )
I even thought of allowing them to create thier own armor etc by taking a bash
on the anvil. Have not worked out the details to that yet however....
have fun.
P.S. silly to long with no space...if you are cutting and pasteing this script
make sure to check spacing.