import title
def OpenTitleSystem(self): self.title = title.Dialog1() self.title.Show()
def __ServerCommand_Build(self): serverCommandList={}
"OpenTitleSystem" : self.OpenTitleSystem,
import uiimport dbgimport appimport chatimport netimport grpimport playerclass Dialog1(ui.Window): def __init__(self): ui.Window.__init__(self) self.BuildWindow() self.r = 1.0 self.g = 1.0 self.b = 1.0 def __del__(self): ui.Window.__del__(self) def BuildWindow(self): self.Board = ui.BoardWithTitleBar() self.Board.SetSize(200, 170) self.Board.SetCenterPosition() self.Board.AddFlag('movable') self.Board.AddFlag('float') self.Board.SetTitleName('Erstelle deinen Titel') self.Board.SetCloseEvent(self.Close) self.Board.Show() self.__BuildKeyDict() self.comp = Component() self.confirm = self.comp.Button(self.Board, 'Titel setzen', '', 60, 125, self.confirm_func, 'd:/ymir work/ui/public/large_button_01.sub', 'd:/ymir work/ui/public/large_button_02.sub', 'd:/ymir work/ui/public/large_button_03.sub') self.slotbar_input, self.input = self.comp.EditLine(self.Board, '', 10, 30, 180, 15, 27) self.Preview = self.comp.TextLine(self.Board, 'Vorschau: ', 14, 110, self.comp.RGB(255, 650, 650)) self.Prev = self.comp.TextLine(self.Board, 'Titel', 66, 110, self.comp.RGB(255, 650, 650)) self.rot = self.comp.SliderBar(self.Board, 0.0, self.rot_func, 12, 50) self.blue = self.comp.SliderBar(self.Board, 0.0, self.blue_func, 12, 70) self.gruen = self.comp.SliderBar(self.Board, 0.0, self.gruen_func, 12, 90) self.rot.SetSliderPos(1.0) self.blue.SetSliderPos(1.0) self.gruen.SetSliderPos(1.0) self.input.SetText("Titel") self.Show() def rot_func(self): self.r = self.rot.GetSliderPos() def blue_func(self): self.b = self.blue.GetSliderPos() def gruen_func(self): self.g = self.gruen.GetSliderPos() def OnRender(self): self.Prev.SetText(self.input.GetText()) self.Prev.SetPackedFontColor(grp.GenerateColor(self.r, self.g, self.b, 1.0)) def confirm_func(self): self.r = int(self.rot.GetSliderPos()*255) self.b = int(self.blue.GetSliderPos()*255) self.g = int(self.gruen.GetSliderPos()*255) player.SetTitle(self.Prev.GetText(), self.r, self.g, self.b, 255) self.Hide() self.Board.Hide() def __BuildKeyDict(self): onPressKeyDict = {} onPressKeyDict[app.DIK_F5] = lambda : self.OpenWindow() self.onPressKeyDict = onPressKeyDict def OnKeyDown(self, key): try: self.onPressKeyDict[key]() except KeyError: pass except: raise return TRUE def OpenWindow(self): if self.Board.IsShow(): self.Board.Hide() else: self.Board.Show() def Close(self): self.Board.Hide()class Component: def Button(self, parent, buttonName, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual): button = ui.Button() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() button.SetEvent(func) return button def ToggleButton(self, parent, buttonName, tooltipText, x, y, funcUp, funcDown, UpVisual, OverVisual, DownVisual): button = ui.ToggleButton() if parent != None: button.SetParent(parent) button.SetPosition(x, y) button.SetUpVisual(UpVisual) button.SetOverVisual(OverVisual) button.SetDownVisual(DownVisual) button.SetText(buttonName) button.SetToolTipText(tooltipText) button.Show() button.SetToggleUpEvent(funcUp) button.SetToggleDownEvent(funcDown) return button def EditLine(self, parent, editlineText, x, y, width, heigh, max): SlotBar = ui.SlotBar() if parent != None: SlotBar.SetParent(parent) SlotBar.SetSize(width, heigh) SlotBar.SetPosition(x, y) SlotBar.Show() Value = ui.EditLine() Value.SetParent(SlotBar) Value.SetSize(width, heigh) Value.SetPosition(1, 1) Value.SetMax(max) Value.SetLimitWidth(width) Value.SetMultiLine() Value.SetText(editlineText) Value.Show() return SlotBar, Value def TextLine(self, parent, textlineText, x, y, color): textline = ui.TextLine() if parent != None: textline.SetParent(parent) textline.SetPosition(x, y) if color != None: textline.SetFontColor(color[0], color[1], color[2]) textline.SetText(textlineText) textline.Show() return textline def RGB(self, r, g, b): return (r*255, g*255, b*255) def SliderBar(self, parent, sliderPos, func, x, y): Slider = ui.SliderBar() if parent != None: Slider.SetParent(parent) Slider.SetPosition(x, y) Slider.SetSliderPos(sliderPos) Slider.Show() Slider.SetEvent(func) return Slider def ExpandedImage(self, parent, x, y, img): image = ui.ExpandedImageBox() if parent != None: image.SetParent(parent) image.SetPosition(x, y) image.LoadImage(img) image.Show() return image def ComboBox(self, parent, text, x, y, width): combo = ui.ComboBox() if parent != None: combo.SetParent(parent) combo.SetPosition(x, y) combo.SetSize(width, 15) combo.SetCurrentItem(text) combo.Show() return combo def ThinBoard(self, parent, moveable, x, y, width, heigh, center): thin = ui.ThinBoard() if parent != None: thin.SetParent(parent) if moveable == TRUE: thin.AddFlag('movable') thin.AddFlag('float') thin.SetSize(width, heigh) thin.SetPosition(x, y) if center == TRUE: thin.SetCenterPosition() thin.Show() return thin def Gauge(self, parent, width, color, x, y): gauge = ui.Gauge() if parent != None: gauge.SetParent(parent) gauge.SetPosition(x, y) gauge.MakeGauge(width, color) gauge.Show() return gauge def ListBoxEx(self, parent, x, y, width, heigh): bar = ui.Bar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width, heigh) bar.SetColor(0x77000000) bar.Show() ListBox=ui.ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(width-15, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return bar, ListBox
TÁRGYID TITLE_ADÓ_TÁRGY
TÁRGYID ETC Ezzel a tárggyal saját színezésű egyedi TITLE-t állíthatsz be magadnak!
TÁRGYID ETC icon/item/tárgyadikonjánakneve.tga
quest title begin state start begin when TÁRGYID.use begin cmdchat("OpenTitleSystem") end endend
ALTER TABLE player.player ADD title varchar(25) DEFAULT '' NOT NULL COLLATE latin1_swedish_ci;ALTER TABLE player.player ADD title_color0 smallint(3) DEFAULT 0 NOT NULL;ALTER TABLE player.player ADD title_color1 smallint(3) DEFAULT 0 NOT NULL;ALTER TABLE player.player ADD title_color2 smallint(3) DEFAULT 0 NOT NULL;ALTER TABLE player.player ADD title_color3 smallint(3) DEFAULT 0 NOT NULL;
SetHair(c_rkCreateData.m_dwHair);
#ifdef __TITLE_SYSTEM m_stTitle = c_rkCreateData.m_stTitle; UpdateTitleName(c_rkCreateData.m_stTitle.c_str()); memcpy(m_bTitleColor, c_rkCreateData.m_bTitleColor, sizeof(m_bTitleColor));#endif
void CInstanceBase::__Initialize(){ [...]}
#ifdef __TITLE_SYSTEM m_stTitle = ""; memset(m_bTitleColor, 0, sizeof(m_bTitleColor));#endif
short m_sAlignment;
#ifdef __TITLE_SYSTEM std::string m_stTitle; BYTE m_bTitleColor[4];#endif
protected: CAffectFlagContainer m_kAffectFlagContainer;
#ifdef __TITLE_SYSTEM void UpdateTitleName(const char* szTitle); void UpdateTitleColor(BYTE* colors); void UpdateTitle(const char* szTitle, BYTE* colors);#endif
class CInstanceBase{ [...]}
#ifdef __TITLE_SYSTEM protected: std::string m_stTitle; BYTE m_bTitleColor[4];#endif
// CHARACTER_LEVEL if (m_dwLevel) { UpdateTextTailLevel(m_dwLevel); }
#ifdef __TITLE_SYSTEM CPythonTextTail::instance().AttachUserTitle(GetVirtualID(), m_stTitle.c_str(), D3DXCOLOR(FLOAT(m_bTitleColor[0]) / 255.0, FLOAT(m_bTitleColor[1]) / 255.0, FLOAT(m_bTitleColor[2]) / 255.0, FLOAT(m_bTitleColor[3]) / 255.0));#endif
#ifdef __TITLE_SYSTEMvoid CInstanceBase::UpdateTitleName(const char* szTitle){ std::string stTitle = szTitle; if (stTitle == m_stTitle) return; m_stTitle = szTitle; CPythonTextTail::instance().UpdateTitleValue(GetVirtualID(), m_stTitle.c_str());}void CInstanceBase::UpdateTitleColor(BYTE* colors){ if (memcmp(m_bTitleColor, colors, sizeof(BYTE) * TITLE_COLOR_MAX_NUM) == 0) return; memcpy(m_bTitleColor, colors, sizeof(m_bTitleColor)); CPythonTextTail::instance().UpdateTitleColor(GetVirtualID(), D3DXCOLOR(FLOAT(m_bTitleColor[0]) / 255.0, FLOAT(m_bTitleColor[1]) / 255.0, FLOAT(m_bTitleColor[2]) / 255.0, FLOAT(m_bTitleColor[3]) / 255.0));}void CInstanceBase::UpdateTitle(const char* szTitle, BYTE* colors){ UpdateTitleName(szTitle); UpdateTitleColor(colors);}#endif
#define __TITLE_SYSTEM
#ifdef __TITLE_SYSTEM#include "Packet.h"#endif
m_stName = src.m_stName;
#ifdef __TITLE_SYSTEM m_stTitle = src.m_stTitle; memcpy(m_bTitleColor, src.m_bTitleColor, sizeof(m_bTitleColor));#endif
m_stName="";
kCreateData.m_stName=rkNetActorData.m_stName;
#ifdef __TITLE_SYSTEM kCreateData.m_stTitle = rkNetActorData.m_stTitle; memcpy(kCreateData.m_bTitleColor, rkNetActorData.m_bTitleColor, sizeof(kCreateData.m_bTitleColor));#endif
#ifdef __TITLE_SYSTEMvoid CNetworkActorManager::UpdateActorTitle(DWORD dwVID, const char* title, const BYTE* bColor){ std::map<DWORD, SNetworkActorData>::iterator f = m_kNetActorDict.find(dwVID); if (m_kNetActorDict.end() == f) {#ifdef _DEBUG TraceError("CNetworkActorManager::UpdateActor(dwVID=%d) - NOT EXIST VID", dwVID);#endif return; } SNetworkActorData& rkNetActorData = f->second; CInstanceBase* pkInstFind = __FindActor(rkNetActorData); if (!pkInstFind) { TraceError("No Instance by %s %u", rkNetActorData.m_stName.c_str(), rkNetActorData.m_dwVID); return; } pkInstFind->UpdateTitle(title, const_cast<BYTE*>(bColor)); memcpy(rkNetActorData.m_bTitleColor, bColor, sizeof(rkNetActorData.m_bTitleColor)); rkNetActorData.m_stTitle = title;}#endif
#ifdef __TITLE_SYSTEM std::string m_stTitle; BYTE m_bTitleColor[TITLE_COLOR_MAX_NUM];#endif
m_sAlignment=0;
void MoveActor(const SNetworkMoveActorData& c_rkNetMoveActorData);
#ifdef __TITLE_SYSTEM void UpdateActorTitle(DWORD dwVID, const char* title, const BYTE * bColor);#endif
HEADER_CG_LOGIN5_OPENID = 116,
#ifdef __TITLE_SYSTEM HEADER_CG_TITLE = 117,#endif
HEADER_GC_QUEST_CONFIRM = 46,
#ifdef __TITLE_SYSTEM HEADER_GC_UPDATE_TITLE = 47,#endif
typedef struct packet_char_additional_info
#ifdef __TITLE_SYSTEMtypedef struct SCharacterTitle{ char szName[TITLE_MAX_NUM + 1]; BYTE bColours[TITLE_COLOR_MAX_NUM + 1];} TCharacterTitle;
DWORD dwMountVnum;
#ifdef __TITLE_SYSTEM TCharacterTitle title;#endif
#ifdef __TITLE_SYSTEM
typedef struct packet_update_title{ BYTE header; DWORD dwVID; TCharacterTitle title;} TPacketGCUpdateTitle;
typedef struct packet_set_title{ BYTE header; TCharacterTitle title;} TPacketCGSetTitle;#endif
Set(HEADER_GC_DRAGON_SOUL_REFINE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCDragonSoulRefine), STATIC_SIZE_PACKET));
#ifdef __TITLE_SYSTEM Set(HEADER_GC_UPDATE_TITLE, CNetworkPacketHeaderMap::TPacketType(sizeof(TPacketGCUpdateTitle), STATIC_SIZE_PACKET));#endif
bool SendTargetPacket(DWORD dwVID);
#ifdef __TITLE_SYSTEM bool SendTitlePacket(const char* title, BYTE r, BYTE g, BYTE b, BYTE a);#endif
bool RecvCharacterUpdatePacket();
#ifdef __TITLE_SYSTEM bool RecvCharacterUpdateTitlePacket();#endif
case HEADER_GC_CHARACTER_UPDATE: ret = RecvCharacterUpdatePacket(); break;
#ifdef __TITLE_SYSTEM case HEADER_GC_UPDATE_TITLE: ret = RecvCharacterUpdateTitlePacket(); break;#endif
#ifdef __TITLE_SYSTEMbool CPythonNetworkStream::SendTitlePacket(const char* title, BYTE r, BYTE g, BYTE b, BYTE a){ TPacketCGSetTitle pack; pack.header = HEADER_CG_TITLE; strcpy(pack.title.szName, title); pack.title.bColours[0] = r; pack.title.bColours[1] = g; pack.title.bColours[2] = b; pack.title.bColours[3] = a; if (!Send(sizeof(pack), &pack)) { Tracen("CPythonNetworkStream::SendTitlePacket - ERROR"); return false; } return true;}#endif
kNetActorData.m_dwLevel = 0;
#ifdef __TITLE_SYSTEM kNetActorData.m_stTitle = ""; memset(kNetActorData.m_bTitleColor, 0, sizeof(kNetActorData.m_bTitleColor));#endif
kNetActorData.m_dwLevel = chrInfoPacket.dwLevel;
#ifdef __TITLE_SYSTEM kNetActorData.m_stTitle = chrInfoPacket.title.szName; memcpy(kNetActorData.m_bTitleColor, chrInfoPacket.title.bColours, sizeof(kNetActorData.m_bTitleColor));#endif
bool CPythonNetworkStream::RecvCharacterAppendPacketNew(){ ...}
#ifdef __TITLE_SYSTEMbool CPythonNetworkStream::RecvCharacterUpdateTitlePacket(){ TPacketGCUpdateTitle chrUpdatePacket; if (!Recv(sizeof(chrUpdatePacket), &chrUpdatePacket)) return false; m_rokNetActorMgr->UpdateActorTitle(chrUpdatePacket.dwVID, chrUpdatePacket.title.szName, chrUpdatePacket.title.bColours);}#endif
#ifdef __TITLE_SYSTEMPyObject* playerSetTitle(PyObject* poSelf, PyObject* poArgs){ char* szTitle; if (!PyTuple_GetString(poArgs, 0, &szTitle)) return Py_BadArgument(); BYTE r, g, b, a = 0; if (!PyTuple_GetInteger(poArgs, 1, &r)) return Py_BadArgument(); if (!PyTuple_GetInteger(poArgs, 2, &g)) return Py_BadArgument(); if (!PyTuple_GetInteger(poArgs, 3, &b)) return Py_BadArgument(); if (!PyTuple_GetInteger(poArgs, 4, &a)) return Py_BadArgument(); CPythonNetworkStream::Instance().SendTitlePacket(szTitle, r, g, b, a); return Py_BuildNone();}#endif
void initPlayer(){ static PyMethodDef s_methods[] = {
#ifdef __TITLE_SYSTEM { "SetTitle", playerSetTitle, METH_VARARGS },#endif
if (pTextTail->pLevelTextInstance) { pTextTail->pLevelTextInstance->Render(); }
#ifdef __TITLE_SYSTEM if (pTextTail->pUserTitleTextInstance) { pTextTail->pUserTitleTextInstance->Render(); }#endif
pTextTail->pLevelTextInstance = NULL;[code] // Rakd alá új sorba:[code]#ifdef __TITLE_SYSTEM pTextTail->pUserTitleTextInstance = NULL;#endif
if (pTextTail->pLevelTextInstance) { CGraphicTextInstance::Delete(pTextTail->pLevelTextInstance); pTextTail->pLevelTextInstance = NULL; }
#ifdef __TITLE_SYSTEM if (pTextTail->pUserTitleTextInstance) { CGraphicTextInstance::Delete(pTextTail->pUserTitleTextInstance); pTextTail->pUserTitleTextInstance = NULL; }#endif
#ifdef __TITLE_SYSTEMvoid CPythonTextTail::AttachUserTitle(DWORD dwVID, const char * c_szText, const D3DXCOLOR & c_rColor){ TTextTailMap::iterator itor = m_CharacterTextTailMap.find(dwVID); if (m_CharacterTextTailMap.end() == itor) return; TTextTail * pTextTail = itor->second; CGraphicTextInstance *& prUserTitle = pTextTail->pUserTitleTextInstance; if (!prUserTitle) { prUserTitle = CGraphicTextInstance::New(); prUserTitle->SetTextPointer(ms_pFont); prUserTitle->SetOutline(true); prUserTitle->SetHorizonalAlign(CGraphicTextInstance::HORIZONTAL_ALIGN_RIGHT); prUserTitle->SetVerticalAlign(CGraphicTextInstance::VERTICAL_ALIGN_BOTTOM); } prUserTitle->SetValue(c_szText); prUserTitle->SetColor(c_rColor.r, c_rColor.g, c_rColor.b); prUserTitle->Update();}void CPythonTextTail::DetachUserTitle(DWORD dwVID){ if (!bPKTitleEnable) return; TTextTailMap::iterator itor = m_CharacterTextTailMap.find(dwVID); if (m_CharacterTextTailMap.end() == itor) return; TTextTail* pTextTail = itor->second; if (pTextTail->pUserTitleTextInstance) { CGraphicTextInstance::Delete(pTextTail->pUserTitleTextInstance); pTextTail->pUserTitleTextInstance = NULL; }}void CPythonTextTail::UpdateTitleColor(DWORD dwVID, const D3DXCOLOR& c_rColor){ TTextTailMap::iterator itor = m_CharacterTextTailMap.find(dwVID); if (m_CharacterTextTailMap.end() == itor) return; TTextTail* pTextTail = itor->second; CGraphicTextInstance*& prUserTitle = pTextTail->pUserTitleTextInstance; if (!prUserTitle) return; prUserTitle->SetColor(c_rColor.r, c_rColor.g, c_rColor.b, c_rColor.a);}void CPythonTextTail::UpdateTitleValue(DWORD dwVID, const char* c_szText){ TTextTailMap::iterator itor = m_CharacterTextTailMap.find(dwVID); if (m_CharacterTextTailMap.end() == itor) return; TTextTail* pTextTail = itor->second; CGraphicTextInstance*& prUserTitle = pTextTail->pUserTitleTextInstance; if (!prUserTitle) return; prUserTitle->SetValue(c_szText);}#endif
if (pTitle){ ...}else{ ...}
if (pTitle) { CGraphicTextInstance * pUserTitle = pTextTail->pUserTitleTextInstance; if(pUserTitle) { int iUTitleWidth, iUTitleHeight; pUserTitle->GetTextSize(&iUTitleWidth, &iUTitleHeight); pUserTitle->SetPosition(pTextTail->x - (iNameWidth / 2) -3, pTextTail->y, pTextTail->z); pUserTitle->Update(); CGraphicTextInstance * pLevel = pTextTail->pLevelTextInstance; if (pLevel) { int iLevelWidth, iLevelHeight; pLevel->GetTextSize(&iLevelWidth, &iLevelHeight); pLevel->SetPosition(pTextTail->x - (iNameWidth / 2) - iUTitleWidth-3, pTextTail->y, pTextTail->z); pLevel->Update();#ifdef ENABLE_LANGUAGE_SYSTEM if(pLanguageInstance) pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 8.0f - iLevelWidth - iUTitleWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10);#endif } } else { int iTitleWidth, iTitleHeight; pTitle->GetTextSize(&iTitleWidth, &iTitleHeight); pTitle->SetPosition(pTextTail->x - (iNameWidth / 2) -3, pTextTail->y, pTextTail->z); pTitle->Update(); CGraphicTextInstance * pLevel = pTextTail->pLevelTextInstance; if (pLevel) { int iLevelWidth, iLevelHeight; pLevel->GetTextSize(&iLevelWidth, &iLevelHeight); pLevel->SetPosition(pTextTail->x - (iNameWidth / 2) - iTitleWidth -3, pTextTail->y, pTextTail->z); pLevel->Update();#ifdef ENABLE_LANGUAGE_SYSTEM if(pLanguageInstance) pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 8.0f - iLevelWidth - iTitleWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10);#endif } } } else { CGraphicTextInstance * pUserTitle = pTextTail->pUserTitleTextInstance; if(pUserTitle) { int iUTitleWidth, iUTitleHeight; pUserTitle->GetTextSize(&iUTitleWidth, &iUTitleHeight); pUserTitle->SetPosition(pTextTail->x - (iNameWidth / 2) -3, pTextTail->y, pTextTail->z); pUserTitle->Update(); CGraphicTextInstance * pLevel = pTextTail->pLevelTextInstance; if (pLevel) { int iLevelWidth, iLevelHeight; pLevel->GetTextSize(&iLevelWidth, &iLevelHeight); pLevel->SetPosition(pTextTail->x - (iNameWidth / 2) - iUTitleWidth-3, pTextTail->y, pTextTail->z); pLevel->Update();#ifdef ENABLE_LANGUAGE_SYSTEM if(pLanguageInstance) pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 8.0f - iLevelWidth - iUTitleWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10);#endif } } else { CGraphicTextInstance * pLevel = pTextTail->pLevelTextInstance; if (pLevel) { int iLevelWidth, iLevelHeight; pLevel->GetTextSize(&iLevelWidth, &iLevelHeight); pLevel->SetPosition(pTextTail->x - (iNameWidth / 2), pTextTail->y, pTextTail->z); pLevel->Update();#ifdef ENABLE_LANGUAGE_SYSTEM if(pLanguageInstance) pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 8.0f - iLevelWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10);#endif } } }
/* if (pLanguageInstance) { CGraphicTextInstance * pLevel = pTextTail->pLevelTextInstance; if (pLevel) { int iLevelWidth, iLevelHeight; pLevel->GetTextSize(&iLevelWidth, &iLevelHeight); if (pTitle) { int iTitleWidth, iTitleHeight; pTitle->GetTextSize (&iTitleWidth, &iTitleHeight); pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 8.0f - iTitleWidth - iLevelWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10); } if (!pTitle) { pLanguageInstance->SetPosition (pTextTail->x - (iNameWidth / 2) - 4.0f - iLevelWidth - pLanguageInstance->GetWidth() - 1.0f, pTextTail->y - 10); } } } */
CGraphicTextInstance* pLevelTextInstance;
#ifdef __TITLE_SYSTEM CGraphicTextInstance* pUserTitleTextInstance;#endif
void DetachLevel(DWORD dwVID);
#ifdef __TITLE_SYSTEM void AttachUserTitle(DWORD dwVID, const char* c_szText, const D3DXCOLOR& c_rColor); void DetachUserTitle(DWORD dwVID); void UpdateTitleColor(DWORD dwVID, const D3DXCOLOR& c_rColor); void UpdateTitleValue(DWORD dwVID, const char* c_szText);#endif
CHARACTER_NAME_MAX_LEN = 24,
#ifdef __TITLE_SYSTEM TITLE_MAX_NUM = 25, TITLE_COLOR_MAX_NUM = 4,#endif
MAX_PASSPOD = 8 ,
#ifdef __TITLE_SYSTEM TITLE_MAX_NUM = 25, TITLE_COLOR_MAX_NUM = 4, // r, g, b, a#endif
typedef struct SPlayerTable
#ifdef __TITLE_SYSTEMtypedef struct SPlayerTitle{ char szName[TITLE_MAX_NUM + 1]; BYTE bColours[TITLE_COLOR_MAX_NUM + 1];} TPlayerTitle;#endif
} TPlayerTable;
#ifdef __TITLE_SYSTEM TPlayerTitle title;#endif
size_t CreatePlayerSaveQuery(char * pszQuery, size_t querySize, TPlayerTable * pkTab)
pkTab->horse_skill_point);
#ifdef __TITLE_SYSTEM for (int i = 0; i< TITLE_COLOR_MAX_NUM; ++i) queryLen += snprintf(pszQuery + queryLen, querySize - queryLen, "title_color%d = '%u', ", i, pkTab->title.bColours[i]);#endif
queryLen += snprintf(pszQuery + queryLen, querySize - queryLen, "skill_level = '%s', ", text);
#ifdef __TITLE_SYSTEM CDBManager::instance().EscapeString(text, pkTab->title.szName, strlen(pkTab->title.szName)); queryLen += snprintf(pszQuery + queryLen, querySize - queryLen, "title = '%s', ", text);#endif
sys_log(0, "[PLAYER_LOAD] Load from PlayerDB pid[%d]", packet->player_id);
#ifdef __TITLE_SYSTEM std::stringstream stColourTables(""); for (int i = 0; i < TITLE_COLOR_MAX_NUM; ++i) { stColourTables << "title_color" << i << ", "; }#endif
"SELECT " "id,name,job,voice,dir,x,y,z,map_index,exit_x,exit_y,exit_map_index,hp,mp,stamina,random_hp,random_sp,playtime," "gold,level,level_step,st,ht,dx,iq,exp," "stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair," "skill_level,quickslot,skill_group," "mobile,horse_level,horse_riding,horse_hp,horse_hp_droptime,horse_stamina,"
#ifdef __TITLE_SYSTEM "title, %s"#endif
GetTablePostfix(), packet->player_id);
#ifdef __TITLE_SYSTEM stColourTables.str().c_str(),#endif
str_to_number(pkTab->horse.sStamina, row[col++]);
#ifdef __TITLE_SYSTEM if (row[col]) strcpy(pkTab->title.szName, row[col]); else memset(pkTab->title.szName, '\0', sizeof(pkTab->title)); col++; for (int i = 0; i<TITLE_COLOR_MAX_NUM; ++i) { str_to_number(pkTab->title.bColours[i], row[col]); col++; }#endif
void CHARACTER::Initialize(){ [...]}
addPacket.dwLevel = GetLevel();
#ifdef __TITLE_SYSTEM strlcpy(addPacket.title.szName, GetTitle(), sizeof(addPacket.title.szName)); memcpy(addPacket.title.bColours, GetTitleColors(), sizeof(addPacket.title.bColours));#endif
tab.horse = GetHorseData();
#ifdef __TITLE_SYSTEM strlcpy(tab.title.szName, GetTitle(), sizeof(tab.title.szName)); memcpy(tab.title.bColours, GetTitleColors(), sizeof(tab.title.bColours));#endif
m_dwPlayerID = t->id;
#ifdef __TITLE_SYSTEM m_stTitle = t->title.szName; memcpy(m_bTitleColor, t->title.bColours, sizeof(m_bTitleColor));#endif
#ifdef __TITLE_SYSTEMconst char * CHARACTER::GetTitle(){ return this->m_stTitle.c_str();}void CHARACTER::SetTitle(const char * title){ m_stTitle = title;}BYTE* CHARACTER::GetTitleColors() const{ return const_cast<BYTE*>(m_bTitleColor);}BYTE CHARACTER::GetTitleColor(int index){ assert(index < TITLE_COLOR_MAX_NUM); return m_bTitleColor[index];}void CHARACTER::SetTitleColor(int index, BYTE val){ assert(index < TITLE_COLOR_MAX_NUM); m_bTitleColor[index] = val;}void CHARACTER::SetTitleColors(const BYTE* colors){ if (!colors) return; memcpy(m_bTitleColor, colors, sizeof(m_bTitleColor));}void CHARACTER::UpdateTitle(){ TPacketGCUpdateTitle pack; pack.header = HEADER_GC_UPDATE_TITLE; pack.dwVID = GetVID(); strlcpy(pack.title.szName, GetTitle(), sizeof(pack.title.szName)); memcpy(pack.title.bColours, m_bTitleColor, sizeof(pack.title.bColours)); PacketAround(&pack, sizeof(pack));}
void FlushDelayedSaveItem();
ifdef __TITLE_SYSTEM void UpdateTitle(); const char * GetTitle(); void SetTitle(const char* title); void SetTitleColor(int index, BYTE val); void SetTitleColors(const BYTE* colors); BYTE* GetTitleColors() const; BYTE GetTitleColor(int index);#endif
// Rakd alá új sorba[code]#ifdef __TITLE_SYSTEM std::string m_stTitle; BYTE m_bTitleColor[TITLE_COLOR_MAX_NUM];#endif
void Refine(LPCHARACTER ch, const char* c_pData);
#ifdef __TITLE_SYSTEM void TitleSystem(LPCHARACTER ch, const char* c_pData);#endif
#ifdef __TITLE_SYSTEMvoid CInputMain::TitleSystem(LPCHARACTER ch, const char* c_pData){ if (!ch) return; if (ch->IsDead() || ch->IsStun()) return; TPacketCGSetTitle* p = (TPacketCGSetTitle*)c_pData; const char* szTitle = p->title.szName; if (!*szTitle) return; for (size_t i = 0; i < strlen(szTitle); ++i) { if (szTitle[i] == '[' || szTitle[i] == ']') // Letter restrictions, you can adjust this easily { char szText[256]; sprintf(szText, "You can't use that letter for the title:%c", szTitle[i]); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(szText)); return; } } int itemCount = ch->CountSpecifyItem(9990); if (itemCount <= 0) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Du hast nicht den nötigen Gegenstand.")); return; } ch->SetTitleColors(p->title.bColours); ch->SetTitle(p->title.szName); ch->UpdateTitle(); ch->RemoveSpecifyItem(9990, 1);}#endif
case HEADER_CG_REFINE: Refine(ch, c_pData); break;
#ifdef __TITLE_SYSTEM case HEADER_CG_TITLE: TitleSystem(ch, c_pData); break;#endif
#pragma pack()
typedef struct packet_update_title{ BYTE header; DWORD dwVID; TPlayerTitle title;} TPacketGCUpdateTitle;
typedef struct packet_set_title{ BYTE header; TPlayerTitle title;} TPacketCGSetTitle;#endif
Set(HEADER_CG_DRAGON_SOUL_REFINE, sizeof(TPacketCGDragonSoulRefine), "DragonSoulRefine", false);[code]// Rakd alá új sorba[code]#ifdef __TITLE_SYSTEM Set(HEADER_CG_TITLE, sizeof(TPacketCGSetTitle), "TitleSystem", false);#endif