import chr
import chrmgr
import skill
import net
import item
import player
import effect
import constInfo
import localeInfo
import emotion
import app
JOB_WARRIOR = 0
JOB_ASSASSIN = 1
JOB_SURA = 2
JOB_SHAMAN = 3
RACE_WARRIOR_M = 0
RACE_ASSASSIN_W = 1
RACE_SURA_M = 2
RACE_SHAMAN_W = 3
RACE_WARRIOR_W = 4
RACE_ASSASSIN_M = 5
RACE_SURA_W = 6
RACE_SHAMAN_M = 7
PASSIVE_GUILD_SKILL_INDEX_LIST = ( 151, )
ACTIVE_GUILD_SKILL_INDEX_LIST = ( 152, 153, 154, 155, 156, 157, )
FACE_IMAGE_DICT = {
RACE_WARRIOR_M : "d:/ymir work/ui/game/windows/face_warrior.sub",
RACE_ASSASSIN_W : "d:/ymir work/ui/game/windows/face_assassin.sub",
RACE_SURA_M : "d:/ymir work/ui/game/windows/face_sura.sub",
RACE_SHAMAN_W : "d:/ymir work/ui/game/windows/face_shaman.sub",
}
# COMBO_TYPE_1 = 0
# COMBO_TYPE_2 = 1
# COMBO_TYPE_3 = 2
# COMBO_INDEX_1 = 0
# COMBO_INDEX_2 = 1
# COMBO_INDEX_3 = 2
# COMBO_INDEX_4 = 3
# COMBO_INDEX_5 = 4
# COMBO_INDEX_6 = 5
# HORSE_SKILL_WILDATTACK = chr.MOTION_SKILL+121
# HORSE_SKILL_CHARGE = chr.MOTION_SKILL+122
# HORSE_SKILL_SPLASH = chr.MOTION_SKILL+123
# GUILD_SKILL_DRAGONBLOOD = chr.MOTION_SKILL+101
# GUILD_SKILL_DRAGONBLESS = chr.MOTION_SKILL+102
# GUILD_SKILL_BLESSARMOR = chr.MOTION_SKILL+103
# GUILD_SKILL_SPPEDUP = chr.MOTION_SKILL+104
# GUILD_SKILL_DRAGONWRATH = chr.MOTION_SKILL+105
# GUILD_SKILL_MAGICUP = chr.MOTION_SKILL+106
# NEW_678TH_SKILL_ENABLE = 0
# SKILL_INDEX_DICT = []
# def __LoadGameNPC():
# try:
# lines = pack_open("npclist.txt", "r").readlines()
# except IOError:
# import dbg
# dbg.LogBox("LoadLocaleError(%(srcFileName)s)" % locals())
# app.Abort()
# for line in lines:
# tokens = line[:-1].split("\t")
# if len(tokens) == 0 or not tokens[0]:
# continue
# try:
# vnum = int(tokens[0])
# except ValueError:
# import dbg
# dbg.LogBox("LoadGameNPC() - %s - line #%d: %s" % (tokens, lines.index(line), line))
# app.Abort()
# try:
# if vnum:
# chrmgr.RegisterRaceName(vnum, tokens[1].strip())
# else:
# chrmgr.RegisterRaceSrcName(tokens[1].strip(), tokens[2].strip())
# except IndexError:
# import dbg
# dbg.LogBox("LoadGameNPC() - %d, %s - line #%d: %s " % (vnum, tokens, lines.index(line), line))
# app.Abort()
# GUILD_BUILDING
# def LoadGuildBuildingList(filename):
# import uiGuild
# uiGuild.BUILDING_DATA_LIST = []
# handle = app.OpenTextFile(filename)
# count = app.GetTextFileLineCount(handle)
# for i in xrange(count):
# line = app.GetTextFileLine(handle, i)
# tokens = line.split("\t")
# TOKEN_VNUM = 0
# TOKEN_TYPE = 1
# TOKEN_NAME = 2
# TOKEN_LOCAL_NAME = 3
# NO_USE_TOKEN_SIZE_1 = 4
# NO_USE_TOKEN_SIZE_2 = 5
# NO_USE_TOKEN_SIZE_3 = 6
# NO_USE_TOKEN_SIZE_4 = 7
# TOKEN_X_ROT_LIMIT = 8
# TOKEN_Y_ROT_LIMIT = 9
# TOKEN_Z_ROT_LIMIT = 10
# TOKEN_PRICE = 11
# TOKEN_MATERIAL = 12
# TOKEN_NPC = 13
# TOKEN_GROUP = 14
# TOKEN_DEPEND_GROUP = 15
# TOKEN_ENABLE_FLAG = 16
# LIMIT_TOKEN_COUNT = 17
# if not tokens[TOKEN_VNUM].isdigit():
# continue
# if len(tokens) < LIMIT_TOKEN_COUNT:
# import dbg
# dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line))
# continue
# ENABLE_FLAG_TYPE_NOT_USE = False
# ENABLE_FLAG_TYPE_USE = True
# ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2
# if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]):
# continue
# vnum = int(tokens[TOKEN_VNUM])
# type = tokens[TOKEN_TYPE]
# name = tokens[TOKEN_NAME]
# localName = tokens[TOKEN_LOCAL_NAME]
# xRotLimit = int(tokens[TOKEN_X_ROT_LIMIT])
# yRotLimit = int(tokens[TOKEN_Y_ROT_LIMIT])
# zRotLimit = int(tokens[TOKEN_Z_ROT_LIMIT])
# price = tokens[TOKEN_PRICE]
# material = tokens[TOKEN_MATERIAL]
# folderName = ""
# if "HEADQUARTER" == type:
# folderName = "headquarter"
# elif "FACILITY" == type:
# folderName = "facility"
# elif "OBJECT" == type:
# folderName = "object"
# elif "WALL" == type:
# folderName = "fence"
# materialList = ["0", "0", "0"]
# if material:
# if material[0] == "\"":
# material = material[1:]
# if material[-1] == "\"":
# material = material[:-1]
# for one in material.split("/"):
# data = one.split(",")
# if 2 != len(data):
# continue
# itemID = int(data[0])
# count = data[1]
# if itemID == uiGuild.MATERIAL_STONE_ID:
# materialList[uiGuild.MATERIAL_STONE_INDEX] = count
# elif itemID == uiGuild.MATERIAL_LOG_ID:
# materialList[uiGuild.MATERIAL_LOG_INDEX] = count
# elif itemID == uiGuild.MATERIAL_PLYWOOD_ID:
# materialList[uiGuild.MATERIAL_PLYWOOD_INDEX] = count
# ## GuildSymbol ?? ??? NPC ??? ??? ??????.
# import chrmgr
# chrmgr.RegisterRaceSrcName(name, folderName)
# chrmgr.RegisterRaceName(vnum, name)
# appendingData = { "VNUM":vnum,
# "TYPE":type,
# "NAME":name,
# "LOCAL_NAME":localName,
# "X_ROT_LIMIT":xRotLimit,
# "Y_ROT_LIMIT":yRotLimit,
# "Z_ROT_LIMIT":zRotLimit,
# "PRICE":price,
# "MATERIAL":materialList,
# "SHOW" : True }
# if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]):
# appendingData["SHOW"] = False
# uiGuild.BUILDING_DATA_LIST.append(appendingData)
# app.CloseTextFile(handle)
############################
# END_OF_GUILD_BUILDING
#loadGameDataDict={
#"INIT" : __InitData,
#"SOUND" : __LoadGameSound,
#"EFFECT" : __LoadGameEffect,
#"WARRIOR" : __LoadGameWarrior,
#"ASSASSIN" : __LoadGameAssassin,
#"SURA" : __LoadGameSura,
#"SHAMAN" : __LoadGameShaman,
#"SKILL" : __LoadGameSkill,
#"NPC" : __LoadGameNPC,
#"RACE_HEIGHT": __LoadRaceHeight,
#}
# def LoadGameData(name):
# global loadGameDataDict
# load=loadGameDataDict.get(name, 0)
# if load:
# loadGameDataDict[name]=0
# load()