Hook to animate through cfanim.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13344 282e977c-c81d-0410-88c4-b93c2d0d6712
master
ryo_saeba 2010-05-30 14:27:37 +00:00
parent 5eb9ed4fb5
commit 1ab27daf16
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# animate.py
# This is one of the files that can be called by an npc_dialog.
# The following code runs when a dialog has a post rule of 'animate'
# The syntax is ["animate", "path to the animation file", "animation"]
# Have the NPC perform the specified animation.
# Path is mandatory, "animation" defaults to the animation specified
# in the file by the "animation" tag.
# During the animation, the NPC will not reply to dialogs at all.
## DIALOGCHECK
## MINARGS 1
## MAXARGS 2
## .*
## .*
## ENDDIALOGCHECK
event = speaker.CreateObject("event_user")
event.Title = "Animator"
event.Slaying = args[0]
anim = ""
if len(args) > 1:
anim = args[1]
speaker.Event(speaker, speaker, anim, 0)