You draw a trigger in the water you want the fish to say in so they cannot go on land. Place a waypoint in the center. place an integer on the fish. then place the fish in the water. The fish swims within the trigger. If a PC comes along wading in the water the fish will attack them. The pc moves out of the water then turns on land and tries to shoot the fish. The fish when reaching the exit of the trigger will jump to the waypoint in the center and be healed so that the pc has to go into the water to kill it.
Code: Select all
void main()
{
object oCreature = GetExitingObject();
object oTarget = GetWaypointByTag("06_post");
int iCoral = GetLocalInt(oCreature, "iFence");
location lDest = GetLocation(oTarget);
int iHP = GetMaxHitPoints(oCreature);
effect eHeal = EffectHeal(iHP);
if(iCoral > 0 )
{ ClearAllActions();
DelayCommand(1.0,AssignCommand(oCreature, ActionJumpToLocation(lDest)));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oCreature);
}
}