View Single Post
Old 06-26-2003, 11:03 AM   #5
Legolas
Jack Burton
 

Join Date: March 31, 2001
Location: The zephyr lands beneath the brine.
Age: 41
Posts: 5,459
The attack script needs not be more than a simple
Quote:
void main()
{
object oDragon = GetObjectByTag("the dragon's tag");

ChangeToStandardFaction(oDragon, STANDARD_FACTION_HOSTILE);
ActionAttack(GetPCSpeaker());
}
For the giving of items, you've two options. One is to create the item on the player character right away, the other is to remove it from the dragon's inventory and add it to that of the player. Both commands are included in the script below. To use the latter, the item does have to be in the dragon's inventory to begin with. You can place it there manually, or use the first script to create the item on the dragon.

Quote:
void main()
{
CreateItemOnObject("Item's blueprint", GetPCSpeaker(), 1);
AssignCommand(Dragon's tag, ActionGiveItem("Item's blueprint", GetPCSpeaker()));
}
The first one is usually best, but because the second line only works when there actually is an item to give, it can be used to give treasure which could also be had by killing the dragon, to remove a magical item the dragon had equipped or simply to prevent anyone from getting the item twice using some loop.
Legolas is offline   Reply With Quote