Gibt es ein How To dafür?
Beiträge von Crypton95
-
-
Hallo,
wie kann man es umstellen, dass die Mobs die Namen aus der mob_proto beziehen? C++ oder Python Lösung?
Der Client ist auf Englisch aber die Mobs Namen auf Deutsch (Diese werden aus der Datenbank geladen)
servios Source
Bitte melden Sie sich an, um dieses Bild zu sehen.
-
Ich benutze ein Offlineshop von Revoot/Great und das Auction House System von Ente.
BILD
Bitte melden Sie sich an, um dieses Bild zu sehen.Mein Auction House holt sich alle Daten aus der Offlineshop Tabelle "player_shop_items"
Die Items verschwinden aus der Datenbank und tauchen im Inventar auf (das ist schonmal gut), allerdings gibt es kein Refresh bei den Offline Shop.... D.H man kann sich die Sachen doppelt holen (Auction House und Offline Shop)!
Gibt es eine Möglichkeit den Offlineshop zu Refreshen oder wenn sich ein Spieler nähert, dass er die Daten aus der DB erneut holt?
Leider habe ich wenig Erfahrung mit C++ und würde auch dafür Geld geben via PP.
Biete 15€ PayPal
-
Weil man auch Libs überschreiben kann/soll
-
Hallo, ich habe bei FreeBSD 12 64 Bit folgendes Problem.
Wenn ich den Server starten will, kommt immer diese Meldung "ELF interpreter /libexec/ld-elf.so.1 not found, error 8"
Ich habe schon probiert
cd /libexec
cp ld-elf.so.1 ld-elf.so.d
reboot
Libs sind ebenfalls aktuell und auf 64 Bit angepasst!
-
*** Paysafecard Exchange ***
Auszahlung:
PayPal (Freunde) / Überweisung (Echtzeit)
Gebühr 10%
╔═════════ K ═ U ═ R ═ S ═════════╗
► 10€ PSC = 9€ ◄
► 20€ PSC = 18€ ◄
► 25€ PSC = 22,50€ ◄
► 50€ PSC = 45€ ◄
► 100€ PSC = 90€ ◄
► ETC ◄
╚═════════════════════════════╝Erreichbar: PN
Auf Anfrage: WhatsApp / TelegramDiscord: Malibu#6432
-
schau mal char_item.cpp nach "ITEM_BROKEN_METIN_VNUM"
Vielleicht die Zeile, grad keine Zeit zum genauer nachsehen:
Code- long socket = pkTarget->GetSocket(i);
- if (socket > 2 && socket != ITEM_BROKEN_METIN_VNUM)
- {
- AutoGiveItem(socket);
- //TItemTable* pTable = ITEM_MANAGER::instance().GetTable(pkTarget->GetSocket(i));
- //pkTarget->SetSocket(i, pTable->alValues[2]);
- // 깨진돌로 대체해준다
- pkTarget->SetSocket(i, ITEM_BROKEN_METIN_VNUM);
- }
Leider funktioniert das trotzdem nicht.
Das ist die char_item.cpp
bool CHARACTER::RefineItem(LPITEM pkItem, LPITEM pkTarget)
{
if (!CanHandleItem())
return false;
if (pkItem->GetSubType() == USE_TUNING)
{
// XXX 성능, 소켓 개량서는 사라졌습니다...
// XXX 성능개량서는 축복의 서가 되었다!
// MUSIN_SCROLL
if (pkItem->GetValue(0) == MUSIN_SCROLL)
RefineInformation(pkTarget->GetCell(), REFINE_TYPE_MUSIN, pkItem->GetCell());
// END_OF_MUSIN_SCROLL
else if (pkItem->GetValue(0) == HYUNIRON_CHN)
RefineInformation(pkTarget->GetCell(), REFINE_TYPE_HYUNIRON, pkItem->GetCell());
else if (pkItem->GetValue(0) == BDRAGON_SCROLL)
{
if (pkTarget->GetRefineSet() != 702) return false;
RefineInformation(pkTarget->GetCell(), REFINE_TYPE_BDRAGON, pkItem->GetCell());
}
else
{
if (pkTarget->GetRefineSet() == 501) return false;
RefineInformation(pkTarget->GetCell(), REFINE_TYPE_SCROLL, pkItem->GetCell());
}
}
else if (pkItem->GetSubType() == USE_DETACHMENT && IS_SET(pkTarget->GetFlag(), ITEM_FLAG_REFINEABLE))
{
LogManager::instance().ItemLog(this, pkTarget, "USE_DETACHMENT", pkTarget->GetName());
bool bHasMetinStone = false;
for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
{
long socket = pkTarget->GetSocket(i);
if (socket > 2 && socket != ITEM_BROKEN_METIN_VNUM)
{
bHasMetinStone = true;
break;
}
}
if (bHasMetinStone)
{
for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i)
{
long socket = pkTarget->GetSocket(i);
if (socket > 2 && socket != ITEM_BROKEN_METIN_VNUM)
{
AutoGiveItem(socket);
//TItemTable* pTable = ITEM_MANAGER::instance().GetTable(pkTarget->GetSocket(i));
//pkTarget->SetSocket(i, pTable->alValues[2]);
// 깨진돌로 대체해준다
pkTarget->SetSocket(i, ITEM_BROKEN_METIN_VNUM);
}
}
pkItem->SetCount(pkItem->GetCount() - 1);
return true;
}
else
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("빼낼 수 있는 메틴석이 없습니다."));
return false;
}
}
return false;
}
-
Hallo,
ich habe ein Problem mit dem Uppen, immer wenn ich ein Item uppe, verschwinden die Steinsplitter nicht...
Gaibt es hierzu eine Lösung C++ ?
Bitte melden Sie sich an, um dieses Bild zu sehen.
-
Zitat
15.05.2018 - Source/Files Released
25.05.2018 - Archiv aufgeräumt
25.05.2018 - Ente Systeme entfernt
Reupload?
Würde gerne ohne Ente Systeme arbeiten
Danke
-
Klar.
Droppen ist ja eine Funktion im src.
Weiß grad nicht wo das stand.
Du kannst ja zum Beispiel auch manche items nicht fallen lassen.
Da dann einfach die vnum filtern in Kombination mit der Anzahl leerer slots im inventar.
Schau dir mal Droppen an und zum Beispiel eine inventar Erweiterung, da lernt man, wie das funktioniert
Ich habe leider nicht so viel EXP mit C++
Bei mir sind 5 Inventar Seiten + Expansion eingebaut
-
Haaaay,
gibt es eine C++ Möglichkeit, den Spieler/GM zu verbieten eine Truhe zu öffnen ,wenn sein Inventar voll ist?
Oder zumindest das Wegwerfen (wenn Inventar voll ist) zu verbieten?Bitte melden Sie sich an, um diesen Link zu sehen.
-
Hallo,
ich bin mir nicht sicher, ob ihr den Bug kennt.
Man spawnt einen Metin Stein und lässt einen aus dem Team den Metin Stein schlagen.
Wenn euer Teamkollege ganz nah neben den Metin Stein stirbt, verlieren die Mobs den Fokus und greifen andere Spieler nicht an.
D.H man kann 1-2 min tot liegen bleiben und den Metin in Ruhe zerstören ohne das die Monster dich angreifen.Gibt es ein C++ fix?
Biete 20€ PayPal an
Bug Video
Bitte melden Sie sich an, um dieses Medienelement zu sehen.
-
Ich habe ein Fehler,
Imemr wenn ich das Item kaufen kommen andere Bonis raus...
Hat einer eine Lösung? wäre sehr sehr dankbar -
40k Client too?
-
This is my syserr.txt
0619 22:39:11369 :: Traceback (most recent call last):
0619 22:39:11369 :: File "networkModule.py", line 239, in SetGamePhase
0619 22:39:11386 :: File "game.py", line 120, in __init__
0619 22:39:11387 :: File "interfaceModule.py", line 340, in MakeInterface
0619 22:39:11387 :: File "interfaceModule.py", line 280, in __MakeDialogs
0619 22:39:11387 :: AttributeError
0619 22:39:11387 :: :
0619 22:39:11387 :: 'module' object has no attribute 'ItemShopWindow'
0619 22:39:11387 ::0619 22:39:11388 :: Traceback (most recent call last):
0619 22:39:11388 :: File "game.py", line 2465, in BINARY_ServerCommand_Run
0619 22:39:11388 :: AttributeError
0619 22:39:11388 :: :
0619 22:39:11388 :: 'GameWindow' object has no attribute 'serverCommander'
0619 22:39:11388 ::0619 22:39:12225 :: Traceback (most recent call last):
0619 22:39:12225 :: File "game.py", line 2465, in BINARY_ServerCommand_Run
0619 22:39:12226 :: AttributeError
0619 22:39:12226 :: :
0619 22:39:12226 :: 'GameWindow' object has no attribute 'serverCommander'
0619 22:39:12226 ::And my uiitemshop.py
import ui, uiToolTip, grp, item, random, event, time, constInfo, dbg, app, uiCommon, chat, math, localeInfo
AFFECT_DICT = uiToolTip.ItemToolTip().AFFECT_DICT
BONUS1_5 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,27,28,29,30,31,32,33,34,35,36,37,38,39,41,43,44,45,48,53,71,72]
BONUS6_7 = [1,2,3,4,5,6,7,8,15,16,64,63,59,60,61,62,78,79,80,81]class ItemShopWindow(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.isLoaded = FALSE
self.__LoadWindow()self.int_pos = [[206,38],[267,50],[319,83],[355,136],[375,199],[358,263],[321,317],[265,346],[206,359],[144,345],[91,314],[53,262],[40,199],[54,137],[92,88],[143,52]]
self.RotationFunc = [0,0,0,0,0,360,0,0]
self.wheelAutoCooldown = None
self.wheelAutoCooldownTime = 5 # time in seconds to clear wheel content after recieve the prize
self.isWheelSpining = FALSE
self.bannerChangeTime = 15 # time in seconds which the banner will change it automatically
self.adminItemList = {}
self.adminTmpAddVnum = 0
self.isSearching = False
self.searchList = []self.bannerVar = {'fadeOut' : 0, 'currentTime' : 0, 'intervallEndTime' : 0, 'currentAlphaValue' : 0, 'currentImage' : 0, 'lastSwitch' : time.clock() + self.bannerChangeTime}
self.bannerOptions = {'folder' : app.GetLocalePath() + '/ui/itemshop/', 'time' : 10, 'timeToFade' : 0.04, 'interval' : 0.05, 'banner_0' : 'banner_0', 'banner_1' : 'banner_1'}self.curPage = 'HOME'
self.__BindObjects()
self.__BindEvents()def __BindObjects(self):
self.board = self.GetChild("board")self.arrows = {'home' : {'mostBought' : 1, 'hotOffers' : 1}, 'itemshop' : {'categorys' : 1, 'items' : 1}, 'logs' : 1}
self.category = {'itemshop' : 0, 'admin' : 0}self.elements = {
'money' : {'coins' : self.GetChild("CoinsValue"), 'drs' : self.GetChild("DrsValue")},
'home' : {'mostBought' : [], 'hotOffers' : [], 'mostBoughtItems' : {'box_0' : ItemBox(), 'box_1' : ItemBox(), 'box_2' : ItemBox()}, 'hotOffersItems' : {'box_0' : ItemBox(), 'box_1' : ItemBox()}, 'buttons' : {'arrowLeft' : self.GetChild("HomeArrowLeft"), 'arrowRight' : self.GetChild("HomeArrowRight"), 'arrowUp' : self.GetChild("HomeArrowUp"), 'arrowDown' : self.GetChild("HomeArrowDown")}, 'banner' : {'banner_0' : self.GetChild("Banner1"), 'banner_1' : self.GetChild("Banner2"), 'change_0' : self.GetChild("ChangeBanner1"), 'change_1' : self.GetChild("ChangeBanner2")}},
'itemshop' : {'buttons' : {'arrowUp' : self.GetChild("ItemShopArrowUp"), 'arrowDown' : self.GetChild("ItemShopArrowDown"), 'arrowLeft' : self.GetChild("ItemShopArrowLeft"), 'arrowRight' : self.GetChild("ItemShopArrowRight")}, 'items' : {'box_0' : ItemBox(), 'box_1' : ItemBox(), 'box_2' : ItemBox(), 'box_3' : ItemBox(), 'box_4' : ItemBox(), 'box_5' : ItemBox(), 'box_6' : ItemBox(), 'box_7' : ItemBox(), 'box_8' : ItemBox()}, 'textline' : {'page_nr' : self.GetChild("ItemShopPageNumber")}},
'wheel' : {'images' : {'bg' : self.GetChild("BgWheel"), 'rotation' : self.GetChild("RotationWheel")}, 'buttons' : {'spin' : self.GetChild("SpinButton")}, 'objects' : {}, 'items' : [], 'best_items' : []},
'logs' : {'items' : {'box_0' : LogBox(), 'box_1' : LogBox(), 'box_2' : LogBox(), 'box_3' : LogBox(), 'box_4' : LogBox(), 'box_5' : LogBox(), 'box_6' : LogBox(), 'box_7' : LogBox(), 'box_8' : LogBox()}, 'textline' : {'page_nr' : self.GetChild("LogsPageNumber")}, 'buttons' : {'arrowLeft' : self.GetChild("LogsArrowLeft"), 'arrowRight' : self.GetChild("LogsArrowRight")}},
'admin' : {
'buttons' : {'addItemTime' : self.GetChild("AdminAddItemTime"), 'addNewItem' : self.GetChild("AdminAddNewItem"), 'return' : self.GetChild("ReturnButton")},
'addItemTimeWindow' : self.GetChild("AddItemTimeWindow"),
'addItemWindow' : self.GetChild("AddItemWindow"),
'categoryListBox' : self.GetChild("CategorysListBox"),
'categoryListBoxScroll' : self.GetChild("CategorysListBoxScroll"),
'itemListBox' : self.GetChild("ItemsListBox"),
'itemListBoxScroll' : self.GetChild("ItemsListBoxScroll"),
'discountBox' : DiscountItemBox(),
'categoryDiscountBox' : DiscountCategoryBox(),
'bonusBoxes' : {'attrtype0' : self.GetChild("AddItemAttrtype0"), 'attrvalue0' : self.GetChild("AddItemAttrvalue0"), 'attrtype1' : self.GetChild("AddItemAttrtype1"), 'attrvalue1' : self.GetChild("AddItemAttrvalue1"), 'attrtype2' : self.GetChild("AddItemAttrtype2"), 'attrvalue2' : self.GetChild("AddItemAttrvalue2"), 'attrtype3' : self.GetChild("AddItemAttrtype3"), 'attrvalue3' : self.GetChild("AddItemAttrvalue3"), 'attrtype4' : self.GetChild("AddItemAttrtype4"), 'attrvalue4' : self.GetChild("AddItemAttrvalue4"), 'attrtype5' : self.GetChild("AddItemAttrtype5"), 'attrvalue5' : self.GetChild("AddItemAttrvalue5"), 'attrtype6' : self.GetChild("AddItemAttrtype6"), 'attrvalue6' : self.GetChild("AddItemAttrvalue6")},
'socketsBoxes' : {'socket0' : self.GetChild("AddItemSocket0"), 'socket1' : self.GetChild("AddItemSocket1"), 'socket2' : self.GetChild("AddItemSocket2")},
'applyAddItem' : self.GetChild("AddItemApply"), 'resetAddItem' : self.GetChild("AddItemReset"), 'iconAddItem' : self.GetChild("AddItemIcon"), 'vnumAddItem' : self.GetChild("AddItemVnum"), 'catAddItem' : self.GetChild("AddItemCat"), 'priceAddItem' : self.GetChild("AddItemPrice"),
}
}self.page = []
self.page.append(self.GetChild("HomeWindow"))
self.page.append(self.GetChild("IShopWindow"))
self.page.append(self.GetChild("WheelWindow"))
self.page.append(self.GetChild("LogsWindow"))
self.page.append(self.GetChild("GmWindow"))self.tab = []
self.tab.append(self.GetChild("HomeTab"))
self.tab.append(self.GetChild("IShopTab"))
self.tab.append(self.GetChild("WheelTab"))
self.tab.append(self.GetChild("LogsTab"))
self.tab.append(self.GetChild("GmTab"))self.tab[4].Hide()
for i in xrange(16):
self.elements['wheel']['objects']['tooltip_%d' % i] = self.CreateToolTip()
self.elements['wheel']['objects']['int_%d' % i] = self.CreateImage(self.elements['wheel']['images']['rotation'], app.GetLocalePath() + "/ui/itemshop/int_icon.tga", self.int_pos[i][0], self.int_pos[i][1])
self.elements['wheel']['objects']['icon_%d' % i] = self.CreateImage(self.elements['wheel']['objects']['int_%d' % i], None, 0, 0)
self.elements['wheel']['objects']['icon_%d' % i].SAFE_SetStringEvent("MOUSE_OVER_IN", self.elements['wheel']['objects']['tooltip_%d' % i].ShowToolTip)
self.elements['wheel']['objects']['icon_%d' % i].SAFE_SetStringEvent("MOUSE_OVER_OUT", self.elements['wheel']['objects']['tooltip_%d' % i].HideToolTip)
self.elements['wheel']['objects']['icon_%d' % i].SetWindowHorizontalAlignCenter()
self.elements['wheel']['objects']['icon_%d' % i].SetWindowVerticalAlignCenter()for i in xrange(6):
self.elements['wheel']['objects']['bgbar_%d' % i] = self.CreateBar(self.GetChild("bgBestItems"), 0, 12+42+66*i, 0, 0)
self.elements['wheel']['objects']['tooltipbests_%d' % i] = self.CreateToolTip()
self.elements['wheel']['objects']['iconbests_%d' % i] = self.CreateImage(self.elements['wheel']['objects']['bgbar_%d' % i], None, 0, 0)
self.elements['wheel']['objects']['iconbests_%d' % i].SAFE_SetStringEvent("MOUSE_OVER_IN", self.elements['wheel']['objects']['tooltipbests_%d' % i].ShowToolTip)
self.elements['wheel']['objects']['iconbests_%d' % i].SAFE_SetStringEvent("MOUSE_OVER_OUT", self.elements['wheel']['objects']['tooltipbests_%d' % i].HideToolTip)
self.elements['wheel']['objects']['iconbests_%d' % i].SetWindowVerticalAlignCenter()
self.elements['wheel']['objects']['namebests_%d' % i] = self.CreateText(self.elements['wheel']['objects']['bgbar_%d' % i])
self.elements['wheel']['objects']['namebests_%d' % i].SetPosition(50, 0)
self.elements['wheel']['objects']['namebests_%d' % i].SetWindowVerticalAlignCenter()
self.elements['wheel']['objects']['namebests_%d' % i].SetVerticalAlignCenter()self.adminAddNewItemToolTip = uiToolTip.ItemToolTip()
self.adminAddNewItemToolTip.Hide()"""for i in xrange(7):
self.elements['admin']['bonusBoxes']['attrtype%d' % i] = DropDown(self.GetChild("AddItemNewBoard"), '-- Ninguno --')
self.elements['admin']['bonusBoxes']['attrtype%d' % i].SetSize(330, 20)
self.elements['admin']['bonusBoxes']['attrtype%d' % i].SetPosition(18, 310-25*i)
if i > 5:
for x in AFFECT_DICT:
if x in BONUS6_7:
self.elements['admin']['bonusBoxes']['attrtype%d' % i].AppendItem(str(AFFECT_DICT[x](0)), x)
else:
for x in AFFECT_DICT:
if x in BONUS1_5:
self.elements['admin']['bonusBoxes']['attrtype%d' % i].AppendItem(str(AFFECT_DICT[x](0)), x)
self.elements['admin']['bonusBoxes']['attrtype%d' % i].Show()"""def __BindEvents(self):
self.board.SetCloseEvent(ui.__mem_func__(self.Close))for i in xrange(len(self.tab)):
self.tab[i].SetEvent(lambda tabName = self.pages[i] : self.SelectPage(tabName))self.elements['itemshop']['buttons']['arrowUp'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'ITEMSHOP_CATEGORYS_UP')
self.elements['itemshop']['buttons']['arrowDown'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'ITEMSHOP_CATEGORYS_DOWN')
self.elements['itemshop']['buttons']['arrowLeft'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'ITEMSHOP_ITEMS_LEFT')
self.elements['itemshop']['buttons']['arrowRight'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'ITEMSHOP_ITEMS_RIGHT')
self.elements['home']['buttons']['arrowRight'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'HOME_MOSTBOUGHT_RIGHT')
self.elements['home']['buttons']['arrowLeft'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'HOME_MOSTBOUGHT_LEFT')
self.elements['home']['buttons']['arrowDown'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'HOME_HOTOFFERS_DOWN')
self.elements['home']['buttons']['arrowUp'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'HOME_HOTOFFERS_UP')
self.elements['logs']['buttons']['arrowLeft'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'LOGS_LEFT')
self.elements['logs']['buttons']['arrowRight'].SetEvent(ui.__mem_func__(self.__OnClickArrow), 'LOGS_RIGHT')self.elements['wheel']['buttons']['spin'].SetEvent(ui.__mem_func__(self.__OnClickRequestSpinWheel))
self.elements['admin']['categoryListBox'].SetScrollBar(self.elements['admin']['categoryListBoxScroll'])
self.elements['admin']['itemListBox'].SetScrollBar(self.elements['admin']['itemListBoxScroll'])self.elements['admin']['buttons']['addItemTime'].SetEvent(ui.__mem_func__(self.__OnClickAdminButton), 'ITEM_TIME')
self.elements['admin']['buttons']['addNewItem'].SetEvent(ui.__mem_func__(self.__OnClickAdminButton), 'ADD_ITEM')self.elements['admin']['applyAddItem'].SetEvent(ui.__mem_func__(self.__OnClickAddNewItem))
self.elements['admin']['resetAddItem'].SetEvent(ui.__mem_func__(self.__OnClickResetAddNewItem))
self.GetChild("SearchButton").SetEvent(ui.__mem_func__(self.__OnClickSearchButton))
self.GetChild("SearchValue").SetReturnEvent(ui.__mem_func__(self.__OnClickSearchButton))for i in xrange(2):
self.elements['home']['banner']['change_%d' % i].SetEvent(ui.__mem_func__(self.SwitchBanner), i)self.elements['admin']['buttons']['return'].SetEvent(ui.__mem_func__(self.SelectPage), 'GM_ZONE')
self.elements['admin']['discountBox'].Open(self.elements['admin']['addItemTimeWindow'], 320, 80)
self.elements['admin']['categoryDiscountBox'].Open(self.elements['admin']['addItemTimeWindow'], 320, 80+180+15)self.elements['itemshop']['items']['box_0'].SetSettings(self.page[1], 160, 9)
self.elements['itemshop']['items']['box_1'].SetSettings(self.page[1], 160+202+14, 9)
self.elements['itemshop']['items']['box_2'].SetSettings(self.page[1], 160+(202+14)*2, 9)
self.elements['itemshop']['items']['box_3'].SetSettings(self.page[1], 160, 9+(76+45+16)+10)
self.elements['itemshop']['items']['box_4'].SetSettings(self.page[1], 160+202+14, 9+(76+45+16)+10)
self.elements['itemshop']['items']['box_5'].SetSettings(self.page[1], 160+(202+14)*2, 9+(76+45+16)+10)
self.elements['itemshop']['items']['box_6'].SetSettings(self.page[1], 160, 9+((76+45+16)+10)*2)
self.elements['itemshop']['items']['box_7'].SetSettings(self.page[1], 160+202+14, 9+((76+45+16)+10)*2)
self.elements['itemshop']['items']['box_8'].SetSettings(self.page[1], 160+(202+14)*2, 9+((76+45+16)+10)*2)self.elements['home']['mostBoughtItems']['box_0'].SetSettings(self.page[0], 39+14+10, 324+14)
self.elements['home']['mostBoughtItems']['box_1'].SetSettings(self.page[0], 39+14+10+202+40, 324+14)
self.elements['home']['mostBoughtItems']['box_2'].SetSettings(self.page[0], 39+14+10+(202+40)*2, 324+14)self.elements['home']['hotOffersItems']['box_0'].SetSettings(self.page[0], 85+14+10+(202+40)*2, 33)
self.elements['home']['hotOffersItems']['box_1'].SetSettings(self.page[0], 85+14+10+(202+40)*2, 33+117+14)self.elements['logs']['items']['box_0'].SetSettings(self.page[3], 25, 18)
self.elements['logs']['items']['box_1'].SetSettings(self.page[3], 25+250+10, 18)
self.elements['logs']['items']['box_2'].SetSettings(self.page[3], 25+(250+10)*2, 18)
self.elements['logs']['items']['box_3'].SetSettings(self.page[3], 25, 18+120+18)
self.elements['logs']['items']['box_4'].SetSettings(self.page[3], 25+250+10, 18+120+18)
self.elements['logs']['items']['box_5'].SetSettings(self.page[3], 25+(250+10)*2, 18+120+18)
self.elements['logs']['items']['box_6'].SetSettings(self.page[3], 25, 18+(120+18)*2)
self.elements['logs']['items']['box_7'].SetSettings(self.page[3], 25+250+10, 18+(120+18)*2)
self.elements['logs']['items']['box_8'].SetSettings(self.page[3], 25+(250+10)*2, 18+(120+18)*2)self.elements['admin']['vnumAddItem'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['catAddItem'].SetFocus))
self.elements['admin']['vnumAddItem'].SetTabEvent(ui.__mem_func__(self.elements['admin']['catAddItem'].SetFocus))
self.elements['admin']['catAddItem'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['priceAddItem'].SetFocus))
self.elements['admin']['catAddItem'].SetTabEvent(ui.__mem_func__(self.elements['admin']['priceAddItem'].SetFocus))
self.elements['admin']['priceAddItem'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype0'].SetFocus))
self.elements['admin']['priceAddItem'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype0'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype0'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue0'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype0'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue0'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue0'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype1'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue0'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype1'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype1'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue1'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype1'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue1'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue1'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype2'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue1'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype2'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype2'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue2'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype2'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue2'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue2'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype3'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue2'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype3'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype3'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue3'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype3'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue3'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue3'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype4'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue3'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype4'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype4'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue4'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype4'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue4'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue4'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype5'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue4'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype5'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype5'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue5'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype5'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue5'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue5'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype6'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue5'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrtype6'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype6'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue6'].SetFocus))
self.elements['admin']['bonusBoxes']['attrtype6'].SetTabEvent(ui.__mem_func__(self.elements['admin']['bonusBoxes']['attrvalue6'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue6'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket0'].SetFocus))
self.elements['admin']['bonusBoxes']['attrvalue6'].SetTabEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket0'].SetFocus))
self.elements['admin']['socketsBoxes']['socket0'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket1'].SetFocus))
self.elements['admin']['socketsBoxes']['socket0'].SetTabEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket1'].SetFocus))
self.elements['admin']['socketsBoxes']['socket1'].SetReturnEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket2'].SetFocus))
self.elements['admin']['socketsBoxes']['socket1'].SetTabEvent(ui.__mem_func__(self.elements['admin']['socketsBoxes']['socket2'].SetFocus))
self.elements['admin']['socketsBoxes']['socket2'].SetReturnEvent(ui.__mem_func__(self.__OnClickAddNewItem))
self.elements['admin']['socketsBoxes']['socket2'].SetTabEvent(ui.__mem_func__(self.__OnClickAddNewItem))self.elements['admin']['iconAddItem'].SAFE_SetStringEvent("MOUSE_OVER_IN", self.adminAddNewItemToolTip.ShowToolTip)
self.elements['admin']['iconAddItem'].SAFE_SetStringEvent("MOUSE_OVER_OUT", self.adminAddNewItemToolTip.HideToolTip)
self.isLoaded = TRUEdef CreateCategoryButton(self, parent, x, y, text, func, arg):
button = ui.Button()
button.SetParent(parent)
button.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
button.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
button.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
button.SetText(text)
button.SetEvent(ui.__mem_func__(func), arg)
button.SetPosition(x, y)
button.Show()
return buttondef CreateToolTip(self):
toolTip = uiToolTip.ItemToolTip()
toolTip.HideToolTip()
return toolTipdef CreateImage(self, parent, src_img, x, y):
img = ui.ExpandedImageBox()
img.SetParent(parent)
img.SetPosition(x, y)
if src_img != None:
img.LoadImage(src_img)
img.Show()
return imgdef CreateBar(self, parent, x, y, sizex, sizey):
bar = ui.Bar()
bar.SetParent(parent)
bar.SetPosition(x, y)
bar.SetSize(sizex, sizey)
bar.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.0))
bar.Show()
return bardef CreateText(self, parent):
text = ui.TextLine()
text.SetParent(parent)
text.Show()
return textdef RefreshIShopCategorys(self):
try:
for i in xrange(12):
self.elements['itemshop']['buttons']['category_%d' % i].Hide()
except:
pass
try:
for i in xrange(min(12, len(self.categorys['itemshop']))):
scrolledId = i + self.arrows['itemshop']['categorys']
self.elements['itemshop']['buttons']['category_%d' % i] = self.CreateCategoryButton(self.page[1], 25, 35+35*i, self.categorys['itemshop'][scrolledId][1], self.__OnClickSelectCategoryIShop, self.categorys['itemshop'][scrolledId][0])
self.elements['itemshop']['buttons']['category_%d' % i].Show()
except:
passif (len(self.categorys['itemshop']) > 12):
if (self.arrows['itemshop']['categorys'] <= 0):
self.elements['itemshop']['buttons']['arrowDown'].Show()
self.elements['itemshop']['buttons']['arrowUp'].Hide()
elif (self.arrows['itemshop']['categorys']+12 < len(self.categorys['itemshop'])):
self.elements['itemshop']['buttons']['arrowDown'].Show()
self.elements['itemshop']['buttons']['arrowUp'].Show()
elif (self.arrows['itemshop']['categorys']+12 >= len(self.categorys['itemshop'])):
self.elements['itemshop']['buttons']['arrowDown'].Hide()
self.elements['itemshop']['buttons']['arrowUp'].Show()
else:
self.elements['itemshop']['buttons']['arrowDown'].Hide()
self.elements['itemshop']['buttons']['arrowUp'].Hide()def RefreshIShopItems(self):
curPage = self.arrows['itemshop']['items']
for i in xrange(9):
self.elements['itemshop']['items']['box_%d' % i].Hide()try:
if self.isSearching:
for i in xrange(min(9, len(self.searchList) - curPage * 9 +9)):
curItem = self.searchList[i + (curPage - 1)*9]
self.elements['itemshop']['items']['box_%d' % i].SetContent(curItem[0], curItem[1], curItem[3], curItem[4], curItem[2])
self.elements['itemshop']['items']['box_%d' % i].SetPercent(curItem[7])
self.elements['itemshop']['items']['box_%d' % i].SetTime(curItem[5], curItem[6])
self.elements['itemshop']['items']['box_%d' % i].Show()
else:
for i in xrange(min(9, len(constInfo.ItemShop['ITEMS']['itemshop'][self.category['itemshop']]) - curPage * 9 +9)):
curItem = constInfo.ItemShop['ITEMS']['itemshop'][self.category['itemshop']][i + (curPage - 1)*9]
self.elements['itemshop']['items']['box_%d' % i].SetContent(curItem[0], curItem[1], curItem[3], curItem[4], curItem[2])
self.elements['itemshop']['items']['box_%d' % i].SetPercent(curItem[7])
self.elements['itemshop']['items']['box_%d' % i].SetTime(curItem[5], curItem[6])
self.elements['itemshop']['items']['box_%d' % i].Show()
except:
self.elements['itemshop']['buttons']['arrowRight'].Hide()
self.elements['itemshop']['buttons']['arrowLeft'].Hide()
self.GetChild("ItemShopPageNumberSlot").Hide()
returnif self.isSearching:
maxPage = math.ceil(float(len(self.searchList))/float(9))
else:
maxPage = math.ceil(float(len(constInfo.ItemShop['ITEMS']['itemshop'][self.category['itemshop']]))/float(9))
if maxPage >= 1:
self.elements['itemshop']['textline']['page_nr'].SetText('%d/%d' % (curPage, maxPage))
self.GetChild("ItemShopPageNumberSlot").Show()
else:
self.GetChild("ItemShopPageNumberSlot").Hide()if self.isSearching:
if curPage * 9 >= len(self.searchList):
self.elements['itemshop']['buttons']['arrowRight'].Hide()
else:
self.elements['itemshop']['buttons']['arrowRight'].Show()
else:
if curPage * 9 >= len(constInfo.ItemShop['ITEMS']['itemshop'][self.category['itemshop']]):
self.elements['itemshop']['buttons']['arrowRight'].Hide()
else:
self.elements['itemshop']['buttons']['arrowRight'].Show()if curPage > 1:
self.elements['itemshop']['buttons']['arrowLeft'].Show()
else:
self.elements['itemshop']['buttons']['arrowLeft'].Hide()def RefreshIShopMostBought(self):
curPage = self.arrows['home']['mostBought']
for i in xrange(3):
self.elements['home']['mostBoughtItems']['box_%d' % i].Hide()try:
for i in xrange(min(3, len(constInfo.ItemShop['ITEMS']['mostBought']) - curPage * 3 +3)):
curItem = constInfo.ItemShop['ITEMS']['mostBought'][i + (curPage - 1)*3]
self.elements['home']['mostBoughtItems']['box_%d' % i].SetContent(curItem[0], curItem[1], curItem[3], curItem[4], curItem[2])
self.elements['home']['mostBoughtItems']['box_%d' % i].SetPercent(curItem[7])
self.elements['home']['mostBoughtItems']['box_%d' % i].SetTime(curItem[5], curItem[6])
self.elements['home']['mostBoughtItems']['box_%d' % i].Show()
except:
self.elements['home']['buttons']['arrowRight'].Hide()
self.elements['home']['buttons']['arrowLeft'].Hide()
returnif curPage * 3 >= len(constInfo.ItemShop['ITEMS']['mostBought']):
self.elements['home']['buttons']['arrowRight'].Hide()
else:
self.elements['home']['buttons']['arrowRight'].Show()if curPage > 1:
self.elements['home']['buttons']['arrowLeft'].Show()
else:
self.elements['home']['buttons']['arrowLeft'].Hide()def RefreshIShopHotOffers(self):
curPage = self.arrows['home']['hotOffers']
for i in xrange(2):
self.elements['home']['hotOffersItems']['box_%d' % i].Hide()try:
for i in xrange(min(2, len(constInfo.ItemShop['ITEMS']['hotOffers']) - curPage * 2 +2)):
curItem = constInfo.ItemShop['ITEMS']['hotOffers'][i + (curPage - 1)*2]
self.elements['home']['hotOffersItems']['box_%d' % i].SetContent(curItem[0], curItem[1], curItem[3], curItem[4], curItem[2])
self.elements['home']['hotOffersItems']['box_%d' % i].SetPercent(curItem[7])
self.elements['home']['hotOffersItems']['box_%d' % i].SetTime(curItem[5], curItem[6])
self.elements['home']['hotOffersItems']['box_%d' % i].Show()
except:
self.elements['home']['buttons']['arrowDown'].Hide()
self.elements['home']['buttons']['arrowUp'].Hide()
returnif curPage * 2 >= len(constInfo.ItemShop['ITEMS']['hotOffers']):
self.elements['home']['buttons']['arrowDown'].Hide()
else:
self.elements['home']['buttons']['arrowDown'].Show()if curPage > 1:
self.elements['home']['buttons']['arrowUp'].Show()
else:
self.elements['home']['buttons']['arrowUp'].Hide()def RefreshWheelOfDestiny(self):
if not self.isWheelSpining:
for i in xrange(8):
self.RotationFunc[i] = 0
for i in xrange(16):
self.elements['wheel']['objects']['icon_%d' % i].Hide()
for i in xrange(6):
self.elements['wheel']['objects']['bgbar_%d' % i].Hide()
self.elements['wheel']['images']['rotation'].SetRotation(self.RotationFunc[1])def RefreshLogs(self):
curPage = self.arrows['logs']
for i in xrange(9):
self.elements['logs']['items']['box_%d' % i].Hide()try:
for i in xrange(min(9, len(constInfo.ItemShop['LOGS']) - curPage * 9 +9)):
curItem = constInfo.ItemShop['LOGS'][i + (curPage - 1)*9]
self.elements['logs']['items']['box_%d' % i].SetContent(curItem[0], curItem[1], curItem[2], curItem[4], curItem[5])
self.elements['logs']['items']['box_%d' % i].SetDate(curItem[3].split('[_]')[0], curItem[3].split('[_]')[1])
self.elements['logs']['items']['box_%d' % i].Show()
except:
self.elements['logs']['buttons']['arrowRight'].Hide()
self.elements['logs']['buttons']['arrowLeft'].Hide()
self.GetChild("LogsPageNumberSlot").Hide()
returnmaxPage = math.ceil(float(len(constInfo.ItemShop['LOGS']))/float(9))
if maxPage >= 1:
self.elements['logs']['textline']['page_nr'].SetText('%d/%d' % (curPage, maxPage))
self.GetChild("LogsPageNumberSlot").Show()
else:
self.GetChild("LogsPageNumberSlot").Hide()if curPage * 9 >= len(constInfo.ItemShop['LOGS']):
self.elements['logs']['buttons']['arrowRight'].Hide()
else:
self.elements['logs']['buttons']['arrowRight'].Show()if curPage > 1:
self.elements['logs']['buttons']['arrowLeft'].Show()
else:
self.elements['logs']['buttons']['arrowLeft'].Hide()def RefreshAdminItems(self):
for cat in self.categorys['itemshop']:
self.adminItemList[cat[0]] = []
self.elements['admin']['categoryListBox'].AppendItem(Item(cat[1]))
self.elements['admin']['categoryListBoxScroll'].SetMiddleBarSize(float(8)/float(len(self.adminItemList)))
self.elements['admin']['categoryListBox'].SetSelectEvent(self.RefreshAdminItemLists)def RefreshAdminItemLists(self, selectItem):
self.elements['admin']['discountBox'].Hide()
cat = self.categorys['itemshop'][self.elements['admin']['categoryListBox'].GetItemIndex(selectItem)][0]
self.elements['admin']['categoryDiscountBox'].SetCategoryID(cat)
self.elements['admin']['categoryDiscountBox'].SetPosition(320, 80)
self.elements['admin']['categoryDiscountBox'].Show()
self.category['admin'] = cat
self.elements['admin']['itemListBox'].RemoveAllItems()
try:
for i in xrange(len(constInfo.ItemShop['ITEMS']['itemshop'][cat])):
item.SelectItem(constInfo.ItemShop['ITEMS']['itemshop'][cat][i][1])
self.elements['admin']['itemListBox'].AppendItem(Item(item.GetItemName()))
self.adminItemList[cat].append(constInfo.ItemShop['ITEMS']['itemshop'][cat][i])
self.elements['admin']['itemListBox'].SetSelectEvent(self.SelectAdminDicountItem)
except:
pass
if len(self.adminItemList[cat]) > 10:
self.elements['admin']['itemListBoxScroll'].SetMiddleBarSize(float(10)/float(len(self.adminItemList[cat])))
self.elements['admin']['itemListBoxScroll'].Show()
else:
self.elements['admin']['itemListBoxScroll'].Hide()def SelectAdminDicountItem(self, selectItem):
itemInfo = constInfo.ItemShop['ITEMS']['itemshop'][self.category['admin']][self.elements['admin']['itemListBox'].GetItemIndex(selectItem)]
self.elements['admin']['discountBox'].SetContent(itemInfo[0], itemInfo[1], itemInfo[3], itemInfo[4])
self.elements['admin']['discountBox'].Show()
self.elements['admin']['categoryDiscountBox'].SetPosition(320, 80+180+15)def SwitchBanner(self, newBanner):
self.bannerVar['lastSwitch'] = time.clock() + self.bannerOptions['time'] + self.bannerOptions['timeToFade']/self.bannerOptions['interval']
self.elements['home']['banner']['banner_1'].LoadImage(self.bannerOptions['folder'] + self.bannerOptions['banner_%d' % self.bannerVar['currentImage']] + '.tga')
self.elements['home']['banner']['banner_1'].Show()
self.elements['home']['banner']['banner_0'].LoadImage(self.bannerOptions['folder'] + self.bannerOptions['banner_%d' % newBanner]+ '.tga')
self.bannerVar['currentImage'] = newBanner
self.SetAlpha(self.elements['home']['banner']['banner_1'], 1.0)
self.bannerVar['fadeOut'] = 1
self.bannerVar['intervallEndTime'] = self.bannerVar['currentTime'] + self.bannerOptions['timeToFade']
if newBanner == 0:
self.elements['home']['banner']['change_1'].SetUp()
self.elements['home']['banner']['change_0'].Down()
elif newBanner == 1:
self.elements['home']['banner']['change_0'].SetUp()
self.elements['home']['banner']['change_1'].Down()def SetAlpha(self, image, alpha):
self.bannerVar['currentAlphaValue'] = alpha
image.SetAlpha(alpha)def CreateWheelPrizesTable(self):
self.elements['wheel']['items'] = []
self.elements['wheel']['best_items'] = []
for i in xrange(14):
self.elements['wheel']['items'].append(constInfo.ItemShop['WOD'][0][random.randrange(0, len(constInfo.ItemShop['WOD'][0])-1)])
for i in xrange(2):
self.elements['wheel']['items'].append(constInfo.ItemShop['WOD'][1][random.randrange(0, len(constInfo.ItemShop['WOD'][1])-1)])
for i in xrange(6):
self.elements['wheel']['best_items'].append(constInfo.ItemShop['WOD'][1][random.randrange(0, len(constInfo.ItemShop['WOD'][1])-1)])def SelectPage(self, pageName):
for tab in self.tab:
tab.SetUp()
for page in self.page:
page.Hide()
self.GetChild("SearchValue").KillFocus()Idx = 0
if pageName == 'HOME':
Idx = 0
self.arrows['home']['mostBought'] = 1
self.arrows['home']['hotOffers'] = 1
self.RefreshIShopMostBought()
self.RefreshIShopHotOffers()
self.SwitchBanner(0)
elif pageName == 'ITEMSHOP':
Idx = 1
self.category['itemshop'] = self.categorys['itemshop'][0][0]
self.arrows['itemshop']['items'] = 1
self.arrows['itemshop']['categorys'] = 0
self.isSearching = False
self.RefreshIShopCategorys()
self.RefreshIShopItems()
elif pageName == 'WHEEL':
Idx = 2
self.RefreshWheelOfDestiny()
elif pageName == 'LOGS':
Idx = 3
self.RefreshLogs()
elif pageName == 'GM_ZONE':
Idx = 4
elif pageName == 'SEARCH':
self.__OnClickAdminButton('NONE')
self.curPage = pageName
self.tab[1].Down()
return
self.__OnClickAdminButton('NONE')
self.curPage = pageName
self.tab[Idx].Down()
self.page[Idx].Show()def __OnClickAdminButton(self, admin):
self.page[4].Hide()
if admin == 'ITEM_TIME':
self.elements['admin']['categoryListBox'].RemoveAllItems()
self.RefreshAdminItems()
self.elements['admin']['itemListBox'].RemoveAllItems()
self.elements['admin']['itemListBoxScroll'].Hide()
self.elements['admin']['discountBox'].Hide()
self.elements['admin']['categoryDiscountBox'].SetPosition(320, 80)
self.elements['admin']['categoryDiscountBox'].Hide()
self.elements['admin']['addItemTimeWindow'].Show()
self.elements['admin']['buttons']['return'].Show()
elif admin == 'ADD_ITEM':
self.__OnClickResetAddNewItem()
self.elements['admin']['addItemWindow'].Show()
self.elements['admin']['buttons']['return'].Show()
elif admin == 'NONE':
self.elements['admin']['addItemTimeWindow'].Hide()
self.elements['admin']['addItemWindow'].Hide()
self.elements['admin']['buttons']['return'].Hide()def __OnClickArrow(self, arrow):
if arrow == 'ITEMSHOP_CATEGORYS_UP':
self.arrows['itemshop']['categorys'] -= 1
self.RefreshIShopCategorys()
elif arrow == 'ITEMSHOP_CATEGORYS_DOWN':
self.arrows['itemshop']['categorys'] += 1
self.RefreshIShopCategorys()
elif arrow == 'ITEMSHOP_ITEMS_LEFT':
self.arrows['itemshop']['items'] -= 1
self.RefreshIShopItems()
elif arrow == 'ITEMSHOP_ITEMS_RIGHT':
self.arrows['itemshop']['items'] += 1
self.RefreshIShopItems()
elif arrow == 'HOME_MOSTBOUGHT_LEFT':
self.arrows['home']['mostBought'] -= 1
self.RefreshIShopMostBought()
elif arrow == 'HOME_MOSTBOUGHT_RIGHT':
self.arrows['home']['mostBought'] += 1
self.RefreshIShopMostBought()
elif arrow == 'HOME_HOTOFFERS_DOWN':
self.arrows['home']['hotOffers'] += 1
self.RefreshIShopHotOffers()
elif arrow == 'HOME_HOTOFFERS_UP':
self.arrows['home']['hotOffers'] -= 1
self.RefreshIShopHotOffers()
elif arrow == 'LOGS_LEFT':
self.arrows['logs'] -= 1
self.RefreshLogs()
elif arrow == 'LOGS_RIGHT':
self.arrows['logs'] += 1
self.RefreshLogs()def __OnClickAddNewItem(self):
attributes,sockets = "",""
for i in xrange(7):
attributes = attributes+self.elements['admin']['bonusBoxes']['attrtype%d' % i].GetText()+'#'+self.elements['admin']['bonusBoxes']['attrvalue%d' % i].GetText()+'#'
for i in xrange(3):
sockets = sockets+self.elements['admin']['socketsBoxes']['socket%d' % i].GetText()+'#'
if self.elements['admin']['vnumAddItem'].GetText() == '0' or self.elements['admin']['vnumAddItem'].GetText() == '' or self.elements['admin']['catAddItem'].GetText() == '0' or self.elements['admin']['catAddItem'].GetText() == '' or self.elements['admin']['priceAddItem'].GetText() == '0' or self.elements['admin']['priceAddItem'].GetText() == '':
return
constInfo.ItemShop['QCMD'] = 'ADD_ITEM#%s#%s#%s#%s#%s' % (self.elements['admin']['catAddItem'].GetText(), self.elements['admin']['vnumAddItem'].GetText(), attributes[:-1], sockets[:-1], self.elements['admin']['priceAddItem'].GetText())
event.QuestButtonClick(constInfo.ItemShop['QID'])def __OnClickResetAddNewItem(self):
for i in xrange(7):
self.elements['admin']['bonusBoxes']['attrtype%d' % i].SetText('0')
self.elements['admin']['bonusBoxes']['attrvalue%d' % i].SetText('0')
for i in xrange(3):
self.elements['admin']['socketsBoxes']['socket%d' % i].SetText('0')
self.elements['admin']['vnumAddItem'].SetText('')
self.elements['admin']['vnumAddItem'].SetFocus()
self.elements['admin']['catAddItem'].SetText('1')
self.elements['admin']['priceAddItem'].SetText('0')
self.elements['admin']['iconAddItem'].Hide()def __OnClickSearchButton(self):
self.SelectPage('ITEMSHOP')
self.searchList = []
item_name = self.GetChild("SearchValue").GetText()
if item_name != "" and item_name != 'Buscar...':
self.isSearching = True
for cat in constInfo.ItemShop['ITEMS']['itemshop']:
for i in xrange(len(constInfo.ItemShop['ITEMS']['itemshop'][cat])):
item.SelectItem(constInfo.ItemShop['ITEMS']['itemshop'][cat][i][1])
if (item_name in item.GetItemName()) or (item_name in item.GetItemName().lower()):
self.searchList.append(constInfo.ItemShop['ITEMS']['itemshop'][cat][i])
self.RefreshIShopItems()def __OnClickSelectCategoryIShop(self, catIdx):
self.isSearching = False
self.category['itemshop'] = catIdx
self.arrows['itemshop']['items'] = 1
self.RefreshIShopItems()def __OnClickRequestSpinWheel(self):
if not self.isWheelSpining:
self.CreateWheelPrizesTable()
constInfo.ItemShop['QCMD'] = 'REQUEST_SPIN_WHEEL#'
event.QuestButtonClick(constInfo.ItemShop['QID'])def SpinWheel(self):
for i in xrange(16):
item.SelectItem(self.elements['wheel']['items'][i])
self.elements['wheel']['objects']['icon_%d' % i].SetParent(self.elements['wheel']['objects']['int_%d' % i])
self.elements['wheel']['objects']['icon_%d' % i].LoadImage(item.GetIconImageFileName())
self.elements['wheel']['objects']['icon_%d' % i].Show()
self.elements['wheel']['objects']['tooltip_%d' % i].ClearToolTip()
self.elements['wheel']['objects']['tooltip_%d' % i].AddItemData(self.elements['wheel']['items'][i], [0,0,0])
self.elements['wheel']['objects']['tooltip_%d' % i].HideToolTip()for i in xrange(6):
item.SelectItem(self.elements['wheel']['best_items'][i])
self.elements['wheel']['objects']['iconbests_%d' % i].LoadImage(item.GetIconImageFileName())
self.elements['wheel']['objects']['namebests_%d' % i].SetText(item.GetItemName())
self.elements['wheel']['objects']['tooltipbests_%d' % i].ClearToolTip()
self.elements['wheel']['objects']['tooltipbests_%d' % i].AddItemData(self.elements['wheel']['best_items'][i], [0,0,0])
self.elements['wheel']['objects']['tooltipbests_%d' % i].HideToolTip()
self.elements['wheel']['objects']['bgbar_%d' % i].SetSize(3+50+self.elements['wheel']['objects']['namebests_%d' % i].GetTextSize()[0], 64)
self.elements['wheel']['objects']['bgbar_%d' % i].SetPosition(0, 66*i)
self.elements['wheel']['objects']['bgbar_%d' % i].SetWindowHorizontalAlignCenter()
self.elements['wheel']['objects']['bgbar_%d' % i].Show()
rand_num = random.randrange(16)
self.RotationFunc[2] = self.RotationFunc[1]
self.RotationFunc[3] = (rand_num-self.RotationFunc[6])*22.5+5*360
self.RotationFunc[6] = rand_num
self.RotationFunc[4] = 5
self.RotationFunc[7] = 1
self.RotationFunc[0] = 1
self.wheelAutoCooldown = None
self.isWheelSpining = TRUEdef SetRotationWheel(self):
if self.RotationFunc[1] >= (self.RotationFunc[2]+360):
self.RotationFunc[1] = self.RotationFunc[1]-360
if self.RotationFunc[3] <= (360*4) and self.RotationFunc[3] > (3*360) and self.RotationFunc[4] != 4:
self.RotationFunc[4] = 4
elif self.RotationFunc[3] <= (360*3) and self.RotationFunc[3] > (2*360) and self.RotationFunc[4] != 3:
self.RotationFunc[4] = 3
elif self.RotationFunc[3] <= (360*2) and self.RotationFunc[3] > (200) and self.RotationFunc[4] != 2:
self.RotationFunc[4] = 2
elif self.RotationFunc[3] <= 200 and self.RotationFunc[3] > 0 and self.RotationFunc[4] != 1:
self.RotationFunc[4] = 1
elif self.RotationFunc[3] <= 0:
dbg.TraceError('Table: %s, Prize: %d, Rand: %d' % (str(self.elements['wheel']['items']), self.elements['wheel']['items'][self.RotationFunc[6]], self.RotationFunc[6]))
constInfo.ItemShop['QCMD'] = 'REQUEST_PRIZE_WHEEL#%d' % self.elements['wheel']['items'][self.RotationFunc[6]]
event.QuestButtonClick(constInfo.ItemShop['QID'])
for i in xrange(8):
self.RotationFunc[i] = 0
self.wheelAutoCooldown = time.clock()+self.wheelAutoCooldownTime
self.isWheelSpining = FALSE
return
self.RotationFunc[3] -= self.RotationFunc[4]
self.RotationFunc[1] += self.RotationFunc[4]
self.elements['wheel']['images']['rotation'].SetRotation(self.RotationFunc[1])def __del__(self):
ui.ScriptWindow.__del__(self)def EnableGMZone(self):
self.tab[4].Show()def Open(self, mode):
if not self.isLoaded:
self.__LoadWindow()self.SelectPage('HOME')
self.SwitchBanner(0)
if mode == 1:
self.EnableGMZone()
self.SetCenterPosition()
self.SetTop()
self.Show()def Close(self):
self.Hide()def Destroy(self):
self.Close()
self.ClearDictionary()def OnPressEscapeKey(self):
self.Close()
return TRUEdef OnPressExitKey(self):
self.Close()
return TRUEdef OnUpdate(self):
if self.wheelAutoCooldown:
if self.wheelAutoCooldown < time.clock():
self.RefreshWheelOfDestiny()
self.wheelAutoCooldown = Noneif self.elements['admin']['vnumAddItem'].GetText() != '0' and self.elements['admin']['vnumAddItem'].GetText() != '':
if self.adminTmpAddVnum != int(self.elements['admin']['vnumAddItem'].GetText()):
try:
self.adminTmpAddVnum = int(self.elements['admin']['vnumAddItem'].GetText())
item.SelectItem(self.adminTmpAddVnum)
self.elements['admin']['iconAddItem'].LoadImage(item.GetIconImageFileName())
self.elements['admin']['iconAddItem'].Show()
self.adminAddNewItemToolTip.ClearToolTip()
self.adminAddNewItemToolTip.AddItemData(self.adminTmpAddVnum, [0, 0, 0])
self.adminAddNewItemToolTip.HideToolTip()
except:
self.elements['admin']['iconAddItem'].Hide()self.elements['money']['coins'].SetText(localeInfo.NumberToMoneyString(constInfo.COINS_DRS[0]).replace('Yang', "MD's"))
self.elements['money']['drs'].SetText(localeInfo.NumberToMoneyString(constInfo.COINS_DRS[1]).replace('Yang', "DR's"))if self.bannerVar['lastSwitch'] < time.clock():
if self.bannerVar['currentImage'] == 0:
self.SwitchBanner(1)
else:
self.SwitchBanner(0)if self.bannerVar['fadeOut'] == 1:
self.bannerVar['currentTime'] = time.clock()if self.bannerVar['currentAlphaValue'] > 0.0:
if self.bannerVar['currentTime'] >= self.bannerVar['intervallEndTime']:
newAlphaValue = self.bannerVar['currentAlphaValue']
newAlphaValue -= self.bannerOptions['interval']
self.SetAlpha(self.elements['home']['banner']['banner_1'], newAlphaValue)
self.bannerVar['intervallEndTime'] = self.bannerVar['currentTime'] + self.bannerOptions['timeToFade']
else:
self.bannerVar['fadeOut'] = 0
self.elements['home']['banner']['banner_1'].Hide()if self.RotationFunc[0] < 1:
return
self.SetRotationWheel()class ItemBox(ui.Window):
def __init__(self):
ui.Window.__init__(self)
self.isLoaded = FALSEself.priceValue = "MD's"
self.time = None
self.runOut = None
self.price = None
self.itemData = [0, [], []]
self.lastTime = None
self.id = -1def __LoadObjects(self):
self.SetSize(192, 107+18)Board = ui.ResizableTextValue()
Board.SetParent(self)
Board.SetSize(192, 76+31)
Board.SetPosition(0, 18)
Board.SetLine('left')
Board.SetLine('right')
Board.SetLine('top')
Board.SetLine('bottom')
Board.Show()
self.Board = BoardTimerBoard = ui.ResizableTextValue()
TimerBoard.SetParent(self)
TimerBoard.SetSize(85, 18)
TimerBoard.SetPosition(22, 0)
TimerBoard.SetLine('left')
TimerBoard.SetLine('right')
TimerBoard.SetLine('top')
TimerBoard.SetText('10h 10m 10s')
TimerBoard.Hide()
self.TimerBoard = TimerBoardPercentBoard = ui.ResizableTextValue()
PercentBoard.SetParent(self)
PercentBoard.SetSize(40, 18)
PercentBoard.SetPosition(137, 0)
PercentBoard.SetLine('left')
PercentBoard.SetLine('right')
PercentBoard.SetLine('top')
PercentBoard.SetText('50%')
PercentBoard.Hide()
self.PercentBoard = PercentBoardItemName = ui.ResizableTextValue()
ItemName.SetParent(self.Board)
ItemName.SetSize(150, 18)
ItemName.SetPosition(41, 1)
ItemName.SetLine('left')
ItemName.SetLine('bottom')
ItemName.Show()
self.ItemName = ItemNameItemPrice = ui.ResizableTextValue()
ItemPrice.SetParent(self.Board)
ItemPrice.SetSize(85, 18)
ItemPrice.SetPosition(106, 19+1)
ItemPrice.SetLine('left')
ItemPrice.SetLine('bottom')
ItemPrice.Show()
self.ItemPrice = ItemPriceItemAmountSlot = ui.ResizableTextValue()
ItemAmountSlot.SetParent(self.Board)
ItemAmountSlot.SetSize(85, 18)
ItemAmountSlot.SetPosition(106, 1+19*2)
ItemAmountSlot.SetLine('left')
ItemAmountSlot.SetLine('bottom')
ItemAmountSlot.Show()
self.ItemAmountSlot = ItemAmountSlotItemAmountTxt = ui.TextLine()
ItemAmountTxt.SetParent(self.ItemAmountSlot)
ItemAmountTxt.SetPosition(11, 0)
ItemAmountTxt.SetWindowHorizontalAlignCenter()
ItemAmountTxt.SetHorizontalAlignCenter()
ItemAmountTxt.SetWindowVerticalAlignCenter()
ItemAmountTxt.SetVerticalAlignCenter()
ItemAmountTxt.SetText('ud.')
ItemAmountTxt.SetOutline()
ItemAmountTxt.SetPackedFontColor(0xffA07970)
ItemAmountTxt.Show()
self.ItemAmountTxt = ItemAmountTxtItemAmount = ui.EditLine()
ItemAmount.SetParent(self.ItemAmountSlot)
ItemAmount.SetSize(10, 18)
ItemAmount.SetPosition((self.ItemAmountSlot.GetWidth()/2)-13, 3)
ItemAmount.SetMax(3)
ItemAmount.SetNumberMode()
ItemAmount.SetText('1')
ItemAmount.SetOutline()
ItemAmount.SetPackedFontColor(0xffA07970)
ItemAmount.Show()
self.ItemAmount = ItemAmountBuyButton = ui.CoolButton()
BuyButton.SetParent(self.Board)
BuyButton.SetSize(75, 12*2)
BuyButton.SetPosition(111, 17+19*3)
BuyButton.SetText('Comprar')
BuyButton.SetEvent(ui.__mem_func__(self.__OnClickBuyButton))
BuyButton.Show()
self.BuyButton = BuyButtonToolTip = uiToolTip.ItemToolTip()
ToolTip.HideToolTip()
self.ToolTip = ToolTipItemIcon = ui.ExpandedImageBox()
ItemIcon.SetParent(self.Board)
ItemIcon.SAFE_SetStringEvent("MOUSE_OVER_IN", self.ToolTip.ShowToolTip)
ItemIcon.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.ToolTip.HideToolTip)
ItemIcon.Show()
self.ItemIcon = ItemIconself.BuyQuestion = uiCommon.QuestionDialog()
self.BuyQuestion.SetAcceptEvent(lambda arg = TRUE: self.AnswerBuyItem(arg))
self.BuyQuestion.SetCancelEvent(lambda arg = FALSE: self.AnswerBuyItem(arg))self.SetSize(self.Board.GetWidth(), self.Board.GetHeight()+(self.TimerBoard.GetHeight()-8))
self.isLoaded = TRUEdef __del__(self):
ui.Window.__del__(self)def SetCoin(self, coin):
self.priceValue = ("MD's", "AP's")[coin-1]def SetContent(self, id, vnum, attrs, sockets, price):
item.SelectItem(vnum)
self.id = id
self.price = priceif item.IsFlag(4) == 1:
self.ItemAmountSlot.Show()
else:
self.ItemAmountSlot.Hide()
self.ItemName.SetText(item.GetItemName())
self.ItemIcon.LoadImage(item.GetIconImageFileName())
self.ItemIcon.SetPosition(40, (49,35,28)[item.GetItemSize()[1]-1])
self.ItemIcon.SetScale(1, (1,1,0.8)[item.GetItemSize()[1]-1])
self.ItemPrice.SetText('Precio: %d %s' % (price, self.priceValue))
self.ItemAmount.SetText('1')
self.ItemAmount.KillFocus()
self.ItemAmount.CanEdit(TRUE)
self.BuyButton.Enable()attrs += [(0,0)]*8
self.itemData = [vnum, attrs, sockets]self.ToolTip.ClearToolTip()
if item.GetLimit(0)[0] == 7:
self.ToolTip.AddItemData(vnum, [sockets[0]+app.GetGlobalTimeStamp(), sockets[1], sockets[2]], attrs)
else:
self.ToolTip.AddItemData(vnum, sockets, attrs)
self.ToolTip.HideToolTip()def SetTime(self, time, runOut):
if time == 0:
self.TimerBoard.Show()
self.time = None
return
else:
self.TimerBoard.Show()
self.time = time
self.runOut = runOut
self.lastTime = 0def SetPercent(self, percent):
if percent == 0:
self.PercentBoard.Show()
else:
self.PercentBoard.SetText('%d%%' % percent)
self.PercentBoard.Show()
self.ItemPrice.SetText('Precio: %d %s' % (math.ceil(self.price-(self.price/100.00)*percent), self.priceValue))def __OnClickBuyButton(self):
self.ItemAmount.KillFocus()
amount = self.ItemAmount.GetText()
price = int(amount) * int(self.ItemPrice.GetText().split(' ')[1])if amount == '1':
self.BuyQuestion.SetText("Quieres comprar %s por %d %s?" % (self.ItemName.GetText(), price, self.priceValue))
else:
self.BuyQuestion.SetText("Quieres comprar %sx %s por %d %s?" % (amount, self.ItemName.GetText(), price, self.priceValue))
self.BuyQuestion.Open()def AnswerBuyItem(self, arg):
if arg:
constInfo.ItemShop['QCMD'] = 'BUY_ITEM#%d#%s' % (self.id, self.ItemAmount.GetText())
event.QuestButtonClick(constInfo.ItemShop['QID'])
self.BuyQuestion.Close()
def OnUpdate(self):
if not self.ItemAmount.IsFocus() and (self.ItemAmount.GetText() == '' or self.ItemAmount.GetText() == '0'):
self.ItemAmount.SetText('1')
if int(self.ItemAmount.GetText()) > 500:
self.ItemAmount.SetText('500')if self.time:
remaining = self.time - app.GetGlobalTimeStamp()
if self.lastTime < time.clock():
if remaining <= 0:
self.time = None
self.PercentBoard.Hide()
self.TimerBoard.Hide()
self.ItemPrice.SetText('Precio: %d %s' % (self.price, self.priceValue))
returnself.lastTime = time.clock() + 1
hoursRemaining = int(remaining) / 3600
minutesRemaining = int(remaining % 3600) / 60
secondsRemaining = int(remaining % 60)
self.TimerBoard.SetText('%dh %dm %ds' % (hoursRemaining, minutesRemaining, secondsRemaining))def SetSettings(self, parent, x, y):
if not self.isLoaded:
self.__LoadObjects()self.SetParent(parent)
self.SetPosition(x, y)
self.SetTop()
self.Show()class LogBox(ui.Window):
def __init__(self):
ui.Window.__init__(self)
self.isLoaded = FALSEdef __LoadObjects(self):
Board = ui.ResizableTextValue()
Board.SetParent(self)
Board.SetSize(230, 110)
Board.SetLine('left')
Board.SetLine('right')
Board.SetLine('top')
Board.SetLine('bottom')
Board.Show()
self.Board = BoardItemName = ui.ResizableTextValue()
ItemName.SetParent(self.Board)
ItemName.SetSize(182, 18)
ItemName.SetPosition(47, 0)
ItemName.SetLine('left')
ItemName.SetLine('bottom')
ItemName.SetLine('top')
ItemName.Show()
self.ItemName = ItemNameToolTip = uiToolTip.ItemToolTip()
ToolTip.HideToolTip()
self.ToolTip = ToolTipItemIcon = ui.ExpandedImageBox()
ItemIcon.SetParent(self.Board)
ItemIcon.SAFE_SetStringEvent("MOUSE_OVER_IN", self.ToolTip.ShowToolTip)
ItemIcon.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.ToolTip.HideToolTip)
ItemIcon.Show()
self.ItemIcon = ItemIconItemPrice = ui.ResizableTextValue()
ItemPrice.SetParent(self.Board)
ItemPrice.SetSize(117, 18)
ItemPrice.SetPosition(112, 19)
ItemPrice.SetLine('left')
ItemPrice.SetLine('bottom')
ItemPrice.Show()
self.ItemPrice = ItemPriceItemDate = ui.ResizableTextValue()
ItemDate.SetParent(self.Board)
ItemDate.SetSize(117, 18)
ItemDate.SetPosition(112, 19*2)
ItemDate.SetLine('left')
ItemDate.SetLine('bottom')
ItemDate.Show()
self.ItemDate = ItemDateItemHour = ui.ResizableTextValue()
ItemHour.SetParent(self.Board)
ItemHour.SetSize(117, 18)
ItemHour.SetPosition(112, 19*3)
ItemHour.SetLine('left')
ItemHour.SetLine('bottom')
ItemHour.Show()
self.ItemHour = ItemHourself.SetSize(self.Board.GetWidth(), self.Board.GetHeight())
self.isLoaded = TRUEdef SetContent(self, vnum, amount, price, attrs, sockets):
item.SelectItem(vnum)if amount > 1:
self.ItemName.SetText('%s %dx' % (item.GetItemName(), amount))
else:
self.ItemName.SetText(item.GetItemName())
self.ItemIcon.LoadImage(item.GetIconImageFileName())
self.ItemIcon.SetPosition(40, (51,37,30)[item.GetItemSize()[1]-1])
self.ItemIcon.SetScale(1, (1,1,0.8)[item.GetItemSize()[1]-1])
self.ItemPrice.SetText('Precio: %d %s' % (price, "MD's"))attrs += [(0,0)]*8
self.ToolTip.ClearToolTip()
if item.GetLimit(0)[0] == 7:
self.ToolTip.AddItemData(vnum, [sockets[0]+app.GetGlobalTimeStamp(), sockets[1], sockets[2]], attrs)
else:
self.ToolTip.AddItemData(vnum, sockets, attrs)
self.ToolTip.HideToolTip()def SetDate(self, date, hour):
self.ItemDate.SetText('Fecha: %s' % date)
self.ItemHour.SetText('Hora: %s' % hour)
def SetSettings(self, parent, x, y):
if not self.isLoaded:
self.__LoadObjects()self.SetParent(parent)
self.SetPosition(x, y)
self.SetTop()
self.Show()class DiscountItemBox(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.isLoaded = False
self.data = [0,0]def __LoadWindow(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/itemshop_discountitembox.py")
except:
import exception
exception.Abort("DiscountItemBox.LoadWindow.LoadObject")try:
self.iconItem = self.GetChild("ItemIcon")
self.nameItem = self.GetChild("ItemName")
self.percent = self.GetChild("Percent")
self.hours = self.GetChild("Hours")
self.minutes = self.GetChild("Minutes")
self.seconds = self.GetChild("Seconds")
self.applyButton = self.GetChild("ApplyButton")
except:
import exception
exception.Abort("DiscountItemBox.LoadWindow.LoadObject")self.toolTip = uiToolTip.ItemToolTip()
self.toolTip.HideToolTip()self.iconItem.SAFE_SetStringEvent("MOUSE_OVER_IN", self.toolTip.ShowToolTip)
self.iconItem.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.toolTip.HideToolTip)self.AcceptQuestion = uiCommon.QuestionDialog()
self.AcceptQuestion.SetAcceptEvent(lambda arg = True: self.AnswerAcceptQuestion(arg))
self.AcceptQuestion.SetCancelEvent(lambda arg = False: self.AnswerAcceptQuestion(arg))
self.applyButton.SetEvent(ui.__mem_func__(self.__OnClickAcceptButton))self.percent.SetReturnEvent(ui.__mem_func__(self.hours.SetFocus))
self.percent.SetTabEvent(ui.__mem_func__(self.hours.SetFocus))
self.hours.SetReturnEvent(ui.__mem_func__(self.minutes.SetFocus))
self.hours.SetTabEvent(ui.__mem_func__(self.minutes.SetFocus))
self.minutes.SetReturnEvent(ui.__mem_func__(self.seconds.SetFocus))
self.minutes.SetTabEvent(ui.__mem_func__(self.seconds.SetFocus))
self.seconds.SetReturnEvent(ui.__mem_func__(self.__OnClickAcceptButton))
self.seconds.SetTabEvent(ui.__mem_func__(self.percent.SetFocus))self.isLoaded = True
def SetContent(self, id, vnum, attrs, sockets):
self.data = [id, vnum]
item.SelectItem(vnum)self.percent.SetText('1')
self.hours.SetText('1')
self.minutes.SetText('1')
self.seconds.SetText('1')
self.iconItem.LoadImage(item.GetIconImageFileName())
self.nameItem.SetText(item.GetItemName())
attrs += [(0,0)]*8
self.toolTip.ClearToolTip()
self.toolTip.AddItemData(vnum, sockets, attrs)
self.toolTip.HideToolTip()def __OnClickAcceptButton(self):
item.SelectItem(self.data[1])
self.AcceptQuestion.SetText("Quieres aplicar un descuento del %d%% a %s por %dh, %dm y %ds?" % (int(self.percent.GetText()), item.GetItemName(), int(self.hours.GetText()), int(self.minutes.GetText()), int(self.seconds.GetText())))
self.AcceptQuestion.Open()def AnswerAcceptQuestion(self, arg):
self.time = (int(self.hours.GetText())*3600)+(int(self.minutes.GetText())*60)+(int(self.seconds.GetText()))
if arg:
constInfo.ItemShop['QCMD'] = 'ADD_ITEM_TIME#%d#%d#%s' % (self.data[0], self.time, self.percent.GetText())
event.QuestButtonClick(constInfo.ItemShop['QID'])
self.AcceptQuestion.Close()def __del__(self):
ui.ScriptWindow.__del__(self)def OnUpdate(self):
if self.percent.IsFocus():
if int(self.percent.GetText()) > 100:
self.percent.SetText('100')def Open(self, parent, x, y):
if not self.isLoaded:
self.__LoadWindow()self.SetParent(parent)
self.SetPosition(x, y)
self.Show()class DiscountCategoryBox(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.isLoaded = False
self.category = 0
def __LoadWindow(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "UIScript/itemshop_discountcategorybox.py")
except:
import exception
exception.Abort("DiscountCategoryBox.LoadWindow.LoadObject")try:
self.percent = self.GetChild("Percent")
self.hours = self.GetChild("Hours")
self.minutes = self.GetChild("Minutes")
self.seconds = self.GetChild("Seconds")
self.applyButton = self.GetChild("ApplyButton")
except:
import exception
exception.Abort("DiscountItemBox.LoadWindow.LoadObject")self.AcceptQuestion = uiCommon.QuestionDialog()
self.AcceptQuestion.SetAcceptEvent(lambda arg = True: self.AnswerAcceptQuestion(arg))
self.AcceptQuestion.SetCancelEvent(lambda arg = False: self.AnswerAcceptQuestion(arg))
self.applyButton.SetEvent(ui.__mem_func__(self.__OnClickAcceptButton))self.percent.SetReturnEvent(ui.__mem_func__(self.hours.SetFocus))
self.percent.SetTabEvent(ui.__mem_func__(self.hours.SetFocus))
self.hours.SetReturnEvent(ui.__mem_func__(self.minutes.SetFocus))
self.hours.SetTabEvent(ui.__mem_func__(self.minutes.SetFocus))
self.minutes.SetReturnEvent(ui.__mem_func__(self.seconds.SetFocus))
self.minutes.SetTabEvent(ui.__mem_func__(self.seconds.SetFocus))
self.seconds.SetReturnEvent(ui.__mem_func__(self.__OnClickAcceptButton))
self.seconds.SetTabEvent(ui.__mem_func__(self.percent.SetFocus))
self.isLoaded = Truedef __del__(self):
ui.ScriptWindow.__del__(self)def SetCategoryID(self, id):
self.category = iddef __OnClickAcceptButton(self):
self.AcceptQuestion.SetText("Quieres aplicar un descuento del %d%% a esta categoria por %dh, %dm y %ds?" % (int(self.percent.GetText()), int(self.hours.GetText()), int(self.minutes.GetText()), int(self.seconds.GetText())))
self.AcceptQuestion.Open()def AnswerAcceptQuestion(self, arg):
self.time = (int(self.hours.GetText())*3600)+(int(self.minutes.GetText())*60)+(int(self.seconds.GetText()))
if arg:
constInfo.ItemShop['QCMD'] = 'ADD_CATEGORY_TIME#%d#%d#%s' % (self.category, self.time, self.percent.GetText())
event.QuestButtonClick(constInfo.ItemShop['QID'])
self.AcceptQuestion.Close()def Open(self, parent, x, y):
if not self.isLoaded:
self.__LoadWindow()self.SetParent(parent)
self.SetPosition(x, y)
self.Show()class Item(ui.ListBoxEx.Item):
def __init__(self, fileName):
ui.ListBoxEx.Item.__init__(self)
self.canLoad = 0
self.text = fileName
if len(fileName) > 40:
self.textLine = self.__CreateTextLine(fileName[:37]+"...")
else:
self.textLine = self.__CreateTextLine(fileName[:40])def __del__(self):
ui.ListBoxEx.Item.__del__(self)def GetText(self):
return self.textdef SetSize(self, width, height):
ui.ListBoxEx.Item.SetSize(self, 6*len(self.textLine.GetText()) + 4, height)def __CreateTextLine(self, fileName):
textLine = ui.TextLine()
textLine.SetParent(self)
textLine.SetPosition(0, 0)
textLine.SetText(fileName)
textLine.Show()
return textLineclass DropDown(ui.Window):
dropped = 0
dropstat = 0
last = 0
lastS = 0
maxh = 95
c = 1
OnChange = None
class Item(ui.ListBoxEx.Item):
def __init__(self,parent, text,value=0):
ui.ListBoxEx.Item.__init__(self)self.textBox=ui.TextLine()
self.textBox.SetParent(self)
self.textBox.SetText(text)
self.textBox.Show()
self.value = value
def GetValue(self):
return self.value
def __del__(self):
ui.ListBoxEx.Item.__del__(self)def __init__(self,parent,tt = "",down=1):
ui.Window.__init__(self,"TOP_MOST")
self.down = down
self.SetParentProxy(parent)
self.bg = ui.Bar("TOP_MOST")
self.bg.SetParent(self)
self.bg.SetPosition(0,0)
self.bg.SetColor(0xc0000000)
self.bg.OnMouseOverIn = self.bgMouseIn
self.bg.OnMouseOverOut = self.bgMouseOut
self.bg.OnMouseLeftButtonDown = self.ExpandMe
self.bg.Show()
self.act = ui.TextLine()
self.act.SetParent(self.bg)
self.act.SetPosition(4,2)
self.act.SetText(tt)
self.act.Show()
self.GetText = self.act.GetTextself.Drop = ui.Bar("TOP_MOST")
self.Drop.SetParent(self.GetParentProxy())
self.Drop.SetPosition(0,21)
self.Drop.SetSize(150,0)
self.Drop.SetColor(0xff0a0a0a)self.ScrollBar = ui.ThinScrollBar()
self.ScrollBar.SetParent(self.Drop)
self.ScrollBar.SetWindowHorizontalAlignRight()
self.ScrollBar.SetPosition(18,0)
self.ScrollBar.SetScrollBarSize(0)
self.ScrollBar.Hide()self.DropList = ui.ListBoxEx()
self.DropList.SetParent(self.Drop)
self.DropList.itemHeight = 12
self.DropList.itemWidth = 311
self.DropList.itemStep = 13
self.DropList.SetPosition(0,0)
self.DropList.SetSize(132,13)
self.DropList.SetScrollBar(self.ScrollBar)
self.DropList.SetSelectEvent(self.SetTitle)
self.DropList.SetViewItemCount(0)
self.DropList.Show()
if tt != "":
self.AppendItemAndSelect(tt)
self.selected = self.DropList.GetSelectedItem()
self.SetSize(120,20)def __del__(self):
ui.Window.__del__(self)
def AppendItem(self,text,value=0):
self.c += 1
self.DropList.AppendItem(self.Item(self,text,value))
self.maxh = min(95, 13*self.c)
if self.c > 7:
self.ScrollBar.Show()def AppendItemAndSelect(self,text,value=0):
self.DropList.AppendItem(self.Item(self,text,value))
self.DropList.SelectIndex(len(self.DropList.itemList)-1)def SelectByAffectId(self,id):
for x in self.DropList.itemList:
if x.value == id:
self.DropList.SelectItem(x)
breakdef SetTitle(self,item):
self.act.SetText(str(item.textBox.GetText()))
self.last = self.DropList.basePos
self.lastS = self.ScrollBar.GetPos()
self.dropped = 0
self.selected = item
if self.OnChange:
self.OnChange()def SetPosition(self,w,h):
ui.Window.SetPosition(self,w,h)
if self.down == 1:
self.Drop.SetPosition(w,h+21)
else:
self.Drop.SetPosition(w,h-self.Drop.GetHeight())def SetSize(self,w,h):
ui.Window.SetSize(self,w,h)
self.bg.SetSize(w,h)
self.Drop.SetSize(w,0)
self.DropList.SetSize(w-18,self.maxh)
for x in self.DropList.itemList:
x.SetSize(w-18,12)
self.ScrollBar.SetPosition(w-18,0)def ExpandMe(self):
if self.dropped == 1:
self.dropped = 0
else:
self.dropped = 1def OnUpdate(self):
iter = 6
if self.Drop.GetHeight() < 50:
self.ScrollBar.Hide()
else:
self.ScrollBar.Show()if self.dropped == 0 and self.dropstat == 1:
if self.Drop.GetHeight() <=0:
self.dropstat = 0
self.Drop.SetSize(self.Drop.GetWidth(),0)
self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight())
self.Drop.Hide()
else:
if self.Drop.GetHeight()-iter < 0:
self.Drop.SetSize(self.Drop.GetWidth(),0)
else:
self.Drop.SetSize(self.Drop.GetWidth(),self.Drop.GetHeight()-iter)
(w,h) = self.GetLocalPosition()
self.SetPosition(w,h)self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight())
self.DropList.SetViewItemCount(int(self.Drop.GetHeight()/13))
self.DropList.SetBasePos(self.last+1)
self.DropList.SetBasePos(self.last)
elif self.dropped == 1 and self.dropstat == 0:
self.Drop.Show()
self.SetTop()
if self.Drop.GetHeight() >=self.maxh:
self.Drop.SetSize(self.Drop.GetWidth(),self.maxh)
self.ScrollBar.SetScrollBarSize(self.maxh)
self.dropstat = 1
self.DropList.SetViewItemCount(7)
self.ScrollBar.SetPos(self.lastS)
else:
self.ScrollBar.SetScrollBarSize(self.Drop.GetHeight()+iter)
self.Drop.SetSize(self.Drop.GetWidth(),self.Drop.GetHeight()+iter)
(w,h) = self.GetLocalPosition()
self.SetPosition(w,h)
self.DropList.SetViewItemCount(int(self.Drop.GetHeight()/13))
self.DropList.SetBasePos(self.last+1)
self.DropList.SetBasePos(self.last)## BG Hover
def bgMouseIn(self):
self.bg.SetColor(0xc00a0a0a)
def bgMouseOut(self):
self.bg.SetColor(0xc0000000)# sh = ItemShopWindow()
# sh.Open(1)
## Shang ~ Nilon2 -
#include "StdAfx.h"
#include "../eterPack/EterPackManager.h"
#include "../eterLib/ResourceManager.h"#include "ItemManager.h"
#include "../UserInterface/Locale_inc.h"
#ifdef ITEM_SOCKET_MAX_NUM = 3,static DWORD s_adwItemProtoKey[4] =
{
173217,
72619434,
408587239,
27973291
};BOOL CItemManager::SelectItemData(DWORD dwIndex)
{
TItemMap::iterator f = m_ItemMap.find(dwIndex);if (m_ItemMap.end() == f)
{
int n = m_vec_ItemRange.size();
for (int i = 0; i < n; i++)
{
CItemData * p = m_vec_ItemRange[i];
const CItemData::TItemTable * pTable = p->GetTable();
if ((pTable->dwVnum < dwIndex) &&
dwIndex < (pTable->dwVnum + pTable->dwVnumRange))
{
m_pSelectedItemData = p;
return TRUE;
}
}
Tracef(" CItemManager::SelectItemData - FIND ERROR [%d]\n", dwIndex);
return FALSE;
}m_pSelectedItemData = f->second;
return TRUE;
}CItemData * CItemManager::GetSelectedItemDataPointer()
{
return m_pSelectedItemData;
}BOOL CItemManager::GetItemDataPointer(DWORD dwItemID, CItemData ** ppItemData)
{
if (0 == dwItemID)
return FALSE;TItemMap::iterator f = m_ItemMap.find(dwItemID);
if (m_ItemMap.end() == f)
{
int n = m_vec_ItemRange.size();
for (int i = 0; i < n; i++)
{
CItemData * p = m_vec_ItemRange[i];
const CItemData::TItemTable * pTable = p->GetTable();
if ((pTable->dwVnum < dwItemID) &&
dwItemID < (pTable->dwVnum + pTable->dwVnumRange))
{
*ppItemData = p;
return TRUE;
}
}
Tracef(" CItemManager::GetItemDataPointer - FIND ERROR [%d]\n", dwItemID);
return FALSE;
}*ppItemData = f->second;
return TRUE;
}CItemData * CItemManager::MakeItemData(DWORD dwIndex)
{
TItemMap::iterator f = m_ItemMap.find(dwIndex);if (m_ItemMap.end() == f)
{
CItemData * pItemData = CItemData::New();m_ItemMap.insert(TItemMap::value_type(dwIndex, pItemData));
return pItemData;
}return f->second;
}////////////////////////////////////////////////////////////////////////////////////////
// Load Item Tablebool CItemManager::LoadItemList(const char * c_szFileName)
{
CMappedFile File;
LPCVOID pData;if (!CEterPackManager::Instance().Get(File, c_szFileName, &pData))
return false;CMemoryTextFileLoader textFileLoader;
textFileLoader.Bind(File.Size(), pData);CTokenVector TokenVector;
for (DWORD i = 0; i < textFileLoader.GetLineCount(); ++i)
{
if (!textFileLoader.SplitLine(i, &TokenVector, "\t"))
continue;if (!(TokenVector.size() == 3 TokenVector.size() == 4))
{
TraceError(" CItemManager::LoadItemList(%s) - StrangeLine in %d\n", c_szFileName, i);
continue;
}const std::string & c_rstrID = TokenVector[0];
//const std::string & c_rstrType = TokenVector[1];
const std::string & c_rstrIcon = TokenVector[2];DWORD dwItemVNum=atoi(c_rstrID.c_str());
CItemData * pItemData = MakeItemData(dwItemVNum);
extern BOOL USE_VIETNAM_CONVERT_WEAPON_VNUM;
if (USE_VIETNAM_CONVERT_WEAPON_VNUM)
{
extern DWORD Vietnam_ConvertWeaponVnum(DWORD vnum);
DWORD dwMildItemVnum = Vietnam_ConvertWeaponVnum(dwItemVNum);
if (dwMildItemVnum == dwItemVNum)
{
if (4 == TokenVector.size())
{
const std::string & c_rstrModelFileName = TokenVector[3];
pItemData->SetDefaultItemData(c_rstrIcon.c_str(), c_rstrModelFileName.c_str());
}
else
{
pItemData->SetDefaultItemData(c_rstrIcon.c_str());
}
}
else
{
DWORD dwMildBaseVnum = dwMildItemVnum / 10 * 10;
char szMildIconPath[MAX_PATH];
sprintf(szMildIconPath, "icon/item/%.5d.tga", dwMildBaseVnum);
if (4 == TokenVector.size())
{
char szMildModelPath[MAX_PATH];
sprintf(szMildModelPath, "d:/ymir work/item/weapon/%.5d.gr2", dwMildBaseVnum);
pItemData->SetDefaultItemData(szMildIconPath, szMildModelPath);
}
else
{
pItemData->SetDefaultItemData(szMildIconPath);
}
}
}
else
{
if (4 == TokenVector.size())
{
const std::string & c_rstrModelFileName = TokenVector[3];
pItemData->SetDefaultItemData(c_rstrIcon.c_str(), c_rstrModelFileName.c_str());
}
else
{
pItemData->SetDefaultItemData(c_rstrIcon.c_str());
}
}
}return true;
}const std::string& __SnapString(const std::string& c_rstSrc, std::string& rstTemp)
{
UINT uSrcLen=c_rstSrc.length();
if (uSrcLen<2)
return c_rstSrc;if (c_rstSrc[0]!='"')
return c_rstSrc;UINT uLeftCut=1;
UINT uRightCut=uSrcLen;
if (c_rstSrc[uSrcLen-1]=='"')
uRightCut=uSrcLen-1;rstTemp=c_rstSrc.substr(uLeftCut, uRightCut-uLeftCut);
return rstTemp;
}bool CItemManager::LoadItemDesc(const char* c_szFileName)
{
const VOID* pvData;
CMappedFile kFile;
if (!CEterPackManager::Instance().Get(kFile, c_szFileName, &pvData))
{
Tracenf("CItemManager::LoadItemDesc(c_szFileName=%s) - Load Error", c_szFileName);
return false;
}CMemoryTextFileLoader kTextFileLoader;
kTextFileLoader.Bind(kFile.Size(), pvData);std::string stTemp;
CTokenVector kTokenVector;
for (DWORD i = 0; i < kTextFileLoader.GetLineCount(); ++i)
{
if (!kTextFileLoader.SplitLineByTab(i, &kTokenVector))
continue;while (kTokenVector.size()<ITEMDESC_COL_NUM)
kTokenVector.push_back("");//assert(kTokenVector.size()==ITEMDESC_COL_NUM);
DWORD dwVnum=atoi(kTokenVector[ITEMDESC_COL_VNUM].c_str());
const std::string& c_rstDesc=kTokenVector[ITEMDESC_COL_DESC];
const std::string& c_rstSumm=kTokenVector[ITEMDESC_COL_SUMM];
TItemMap::iterator f = m_ItemMap.find(dwVnum);
if (m_ItemMap.end() == f)
continue;CItemData* pkItemDataFind = f->second;
pkItemDataFind->SetDescription(__SnapString(c_rstDesc, stTemp));
pkItemDataFind->SetSummary(__SnapString(c_rstSumm, stTemp));
}
return true;
}DWORD GetHashCode( const char* pString )
{
unsigned long i,len;
unsigned long ch;
unsigned long result;
len = strlen( pString );
result = 5381;
for( i=0; i<len; i++ )
{
ch = (unsigned long)pString[i];
result = ((result<< 5) + result) + ch; // hash * 33 + ch
}return result;
}bool CItemManager::LoadItemTable(const char* c_szFileName)
{
CMappedFile file;
LPCVOID pvData;if (!CEterPackManager::Instance().Get(file, c_szFileName, &pvData))
return false;DWORD dwFourCC, dwElements, dwDataSize;
DWORD dwVersion=0;
DWORD dwStride=0;file.Read(&dwFourCC, sizeof(DWORD));
if (dwFourCC == MAKEFOURCC('M', 'I', 'P', 'X'))
{
file.Read(&dwVersion, sizeof(DWORD));
file.Read(&dwStride, sizeof(DWORD));
if (dwVersion != 1)
{
TraceError("CPythonItem::LoadItemTable: invalid item_proto[%s] VERSION[%d]", c_szFileName, dwVersion);
return false;
}
if (dwStride != sizeof(CItemData::TItemTable))
{
TraceError("CPythonItem::LoadItemTable: invalid item_proto[%s] STRIDE[%d] != sizeof(SItemTable)",
c_szFileName, dwStride, sizeof(CItemData::TItemTable));
return false;
}
}
else if (dwFourCC != MAKEFOURCC('M', 'I', 'P', 'T'))
{
TraceError("CPythonItem::LoadItemTable: invalid item proto type %s", c_szFileName);
return false;
}file.Read(&dwElements, sizeof(DWORD));
file.Read(&dwDataSize, sizeof(DWORD));BYTE * pbData = new BYTE[dwDataSize];
file.Read(pbData, dwDataSize);/////
CLZObject zObj;
if (!CLZO::Instance().Decompress(zObj, pbData, s_adwItemProtoKey))
{
delete [] pbData;
return false;
}/////
char szName[64+1];
CItemData::TItemTable * table = (CItemData::TItemTable *) zObj.GetBuffer();
std::map<DWORD,DWORD> itemNameMap;for (DWORD i = 0; i < dwElements; ++i, ++table)
{
CItemData * pItemData;
DWORD dwVnum = table->dwVnum;TItemMap::iterator f = m_ItemMap.find(dwVnum);
if (m_ItemMap.end() == f)
{
_snprintf(szName, sizeof(szName), "icon/item/%05d.tga", dwVnum);if (CResourceManager::Instance().IsFileExist(szName) == false)
{
std::map<DWORD, DWORD>::iterator itVnum = itemNameMap.find(GetHashCode(table->szName));if (itVnum != itemNameMap.end())
_snprintf(szName, sizeof(szName), "icon/item/%05d.tga", itVnum->second);
else
_snprintf(szName, sizeof(szName), "icon/item/%05d.tga", dwVnum-dwVnum % 10);if (CResourceManager::Instance().IsFileExist(szName) == false)
{
#ifdef _DEBUG
TraceError("%16s(#%-5d) cannot find icon file. setting to default.", table->szName, dwVnum);
#endif
const DWORD EmptyBowl = 27995;
_snprintf(szName, sizeof(szName), "icon/item/%05d.tga", EmptyBowl);
}
}pItemData = CItemData::New();
pItemData->SetDefaultItemData(szName);
m_ItemMap.insert(TItemMap::value_type(dwVnum, pItemData));
}
else
{
pItemData = f->second;
}
if (itemNameMap.find(GetHashCode(table->szName)) == itemNameMap.end())
itemNameMap.insert(std::map<DWORD,DWORD>::value_type(GetHashCode(table->szName),table->dwVnum));
pItemData->SetItemTableData(table);
if (0 != table->dwVnumRange)
{
m_vec_ItemRange.push_back(pItemData);
}
#ifdef ENABLE_SHINING_SYSTEM
bool CItemManager::LoadShiningTable(const char* szShiningTable)
{
CMappedFile File;
LPCVOID pData;
if (!CEterPackManager::Instance().Get(File, szShiningTable, &pData))
return false;
CMemoryTextFileLoader textFileLoader;
textFileLoader.Bind(File.Size(), pData);
CTokenVector TokenVector;
for (DWORD i = 0; i < textFileLoader.GetLineCount(); ++i)
{
if (!textFileLoader.SplitLine(i, &TokenVector, "\t"))
continue;
if (TokenVector.size() >(1 + CItemData::ITEM_SHINING_MAX_COUNT))
{
TraceError("CItemManager::LoadShiningTable(%s) - LoadShiningTable in %d\n - RowSize: %d MaxRowSize: %d", szShiningTable, i, TokenVector.size(), CItemData::ITEM_SHINING_MAX_COUNT);
}
const std::string & c_rstrID = TokenVector[0];
int pos = c_rstrID.find("~");
std::vector<DWORD> vec_Vnums;
if (std::string::npos == pos)
{
DWORD dwItemVNum = atoi(c_rstrID.c_str());
vec_Vnums.emplace_back(dwItemVNum);
}
else
{
std::string s_start_vnum(c_rstrID.substr(0, pos));
std::string s_end_vnum(c_rstrID.substr(pos + 1));
int start_vnum = atoi(s_start_vnum.c_str());
int end_vnum = atoi(s_end_vnum.c_str());if (start_vnum >= end_vnum)
{
TraceError("ShiningSystem: start_vnum(%d) is greater or equal end_vnum(%) in line $i", start_vnum, end_vnum, i + 1);
continue;
}
DWORD vnum = start_vnum;
while (vnum <= end_vnum)
{
vec_Vnums.emplace_back(vnum);
++vnum;
}
}
for (auto vnum : vec_Vnums)
{
CItemData * pItemData = MakeItemData(vnum);
if (pItemData)
{
for (BYTE i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
{
if (i < (TokenVector.size() - 1))
{
const std::string & c_rstrEffectPath = TokenVector[i + 1];
pItemData->SetItemShiningTableData(i, c_rstrEffectPath.c_str());
}
else
{
pItemData->SetItemShiningTableData(i, "");
}
}
}
}
}
return true;
}
#endif
}//!@#
// CItemData::TItemTable * table = (CItemData::TItemTable *) zObj.GetBuffer();
// for (DWORD i = 0; i < dwElements; ++i, ++table)
// {
//CItemData * pItemData;
//DWORD dwVnum = table->dwVnum;
//
//TItemMap::iterator f = m_ItemMap.find(dwVnum);
//
//if (m_ItemMap.end() == f)
//{
//pItemData = CItemData::New();
//
//pItemData->LoadItemData(_getf("d:/ymir work/item/%05d.msm", dwVnum));
//m_ItemMap.insert(TItemMap::value_type(dwVnum, pItemData));
//}
//else
//{
//pItemData = f->second;
//}
//pItemData->SetItemTableData(table);
// }delete [] pbData;
return true;
}void CItemManager::Destroy()
{
TItemMap::iterator i;
for (i=m_ItemMap.begin(); i!=m_ItemMap.end(); ++i)
CItemData::Delete(i->second);m_ItemMap.clear();
}CItemManager::CItemManager() : m_pSelectedItemData(NULL)
{
}
CItemManager::~CItemManager()
{
Destroy();
} -
Bitte melden Sie sich an, um dieses Bild zu sehen.
-
Ich verteile Punkte allerdings wird es nicht Aktualisiert.
Bitte melden Sie sich an, um diesen Link zu sehen.
Gibt es ein C++/Source/Python Fix ? -
Ich habe Waffen Kostüme eingefügt und es ist alles Okay, nun ist es so dass wenn ich auf mein Pferd sitze und mich Teleportiere es sofort stirbt.
Hat einer ne Idee woran es liegen könnte?überprüfen der Großschreibung am Satzanfang.
-
Problem und ein Bug ist.
wenn du es einfügst wird dein "Fertigkeit Fenster" leer sein.
Du musst die Skills zurücksetzten und wieder neu verteilen.
Das ist ein echter kack Bug