Crossfire Server, Trunk
animate.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # animate.py
3 # This is one of the files that can be called by an npc_dialog.
4 # The following code runs when a dialog has a post rule of 'animate'
5 # The syntax is ["animate", "path to the animation file", "animation"]
6 # Have the NPC perform the specified animation.
7 # Path is mandatory, "animation" defaults to the animation specified
8 # in the file by the "animation" tag.
9 # During the animation, the NPC will not reply to dialogs at all.
10 
16 
17 event = speaker.CreateObject("event_user")
18 event.Title = "Animator"
19 event.Slaying = args[0]
20 anim = ""
21 if len(args) > 1:
22  anim = args[1]
23 speaker.Event(speaker, speaker, anim, 0)