Super Hilfsbereit und Schneller Service gern wieder
Beiträge von Onkelz
-
-
Vermutlich hat er nur das Problem das er sich auf Navicat nicht Verbinden kann weil er fliege files nutzt und die müssen mit Navicat Premium über SSH Tunnel angesteuert werden
-
haste zufällig ein link da wüsste nicht nach was ich schauen sollte kenne mich dort noch nicht aus mit
-
ok mir geht es nicht um den kreis oder sonstiges ich find einfach das blaue aura mega geil
-
keine ahnung dies weiß ich nicht hab es lediglich bei Shirana gesehen und hier war es release
Bitte melden Sie sich an, um diesen Link zu sehen.
dies hatte er in seinen files auch drinn leider sind nur die bilder down
-
danke schön weiß jemand wie ich das machen kann oder sind das neue skills die extra angefertigt wurden sind ?
-
hab ich genau so gemacht :
#PVM Kette
section
npc 20400
item 17209 1
item 27992 25
item 27993 25
item 27994 25
allow_copy 1
reward 999150 1
gold 20000000
percent 100
end
die service.h ist ja in dem source unter command drinn , die wird ja automatisch mit der game gepackt oder ?
-
Guten Tag,
Ich füge grad dieses System hinzu :
Bitte melden Sie sich an, um diesen Link zu sehen.
Ich packe die game ohne error aber ingame übernimmt er die bonis einach nicht.
Cube.cpp
Code- #include "stdafx.h"
- #include "config.h"
- #include "constants.h"
- #include "utils.h"
- #include "log.h"
- #include "char.h"
- #include "locale_service.h"
- #include "item.h"
- #include "item_manager.h"
- #include <sstream>
- #define RETURN_IF_CUBE_IS_NOT_OPENED(ch) if (!(ch)->IsCubeOpen()) return
- static std::vector<CUBE_DATA*> s_cube_proto;
- static bool s_isInitializedCubeMaterialInformation = false;
- typedef std::vector<CUBE_VALUE> TCubeValueVector;
- struct SCubeMaterialInfo
- {
- SCubeMaterialInfo()
- {
- bHaveComplicateMaterial = false;
- };
- CUBE_VALUE reward;
- TCubeValueVector material;
- DWORD gold;
- TCubeValueVector complicateMaterial;
- std::string infoText;
- bool bHaveComplicateMaterial;
- };
- struct SItemNameAndLevel
- {
- SItemNameAndLevel()
- {
- level = 0;
- }
- std::string name;
- int level;
- };
- typedef std::vector<SCubeMaterialInfo> TCubeResultList;
- typedef boost::unordered_map<DWORD, TCubeResultList> TCubeMapByNPC;
- typedef boost::unordered_map<DWORD, std::string> TCubeResultInfoTextByNPC;
- TCubeMapByNPC cube_info_map;
- TCubeResultInfoTextByNPC cube_result_info_map_by_npc;
- class CCubeMaterialInfoHelper
- {
- };
- static bool FN_check_item_count(LPITEM* items, DWORD item_vnum, int need_count)
- {
- int count = 0;
- for(int i = 0; i < CUBE_MAX_NUM; ++i)
- {
- if(NULL == items[i])
- {
- continue;
- }
- if(item_vnum == items[i]->GetVnum())
- {
- count += items[i]->GetCount();
- }
- }
- return (count >= need_count);
- }
- static void FN_remove_material(LPITEM* items, DWORD item_vnum, int need_count)
- {
- int count = 0;
- LPITEM item = NULL;
- for(int i = 0; i < CUBE_MAX_NUM; ++i)
- {
- if(NULL == items[i])
- {
- continue;
- }
- item = items[i];
- if(item_vnum == item->GetVnum())
- {
- count += item->GetCount();
- if(count > need_count)
- {
- item->SetCount(count - need_count);
- return;
- }
- else
- {
- item->SetCount(0);
- items[i] = NULL;
- }
- }
- }
- }
- static CUBE_DATA* FN_find_cube(LPITEM* items, WORD npc_vnum)
- {
- DWORD i, end_index;
- if(0 == npc_vnum)
- {
- return NULL;
- }
- end_index = s_cube_proto.size();
- for(i = 0; i < end_index; ++i)
- {
- if(s_cube_proto[i]->can_make_item(items, npc_vnum))
- {
- return s_cube_proto[i];
- }
- }
- return NULL;
- }
- static bool FN_check_valid_npc(WORD vnum)
- {
- for(auto iter = s_cube_proto.begin(); iter != s_cube_proto.end(); iter++)
- {
- if(std::find((*iter)->npc_vnum.begin(), (*iter)->npc_vnum.end(), vnum) != (*iter)->npc_vnum.end())
- {
- return true;
- }
- }
- return false;
- }
- static bool FN_check_cube_data(CUBE_DATA* cube_data)
- {
- DWORD i = 0;
- DWORD end_index = 0;
- end_index = cube_data->npc_vnum.size();
- for(i = 0; i < end_index; ++i)
- {
- if(cube_data->npc_vnum[i] == 0)
- {
- return false;
- }
- }
- end_index = cube_data->item.size();
- for(i = 0; i < end_index; ++i)
- {
- if(cube_data->item[i].vnum == 0)
- {
- return false;
- }
- if(cube_data->item[i].count == 0)
- {
- return false;
- }
- }
- end_index = cube_data->reward.size();
- for(i = 0; i < end_index; ++i)
- {
- if(cube_data->reward[i].vnum == 0)
- {
- return false;
- }
- if(cube_data->reward[i].count == 0)
- {
- return false;
- }
- }
- return true;
- }
- CUBE_DATA::CUBE_DATA()
- {
- this->percent = 0;
- this->gold = 0;
- #ifdef ENABLE_CUBE_RENEWAL
- this->allowCopyAttr = false;
- #endif
- }
- bool CUBE_DATA::can_make_item(LPITEM* items, WORD npc_vnum)
- {
- DWORD i, end_index;
- DWORD need_vnum;
- int need_count;
- int found_npc = false;
- end_index = this->npc_vnum.size();
- for(i = 0; i < end_index; ++i)
- {
- if(npc_vnum == this->npc_vnum[i])
- {
- found_npc = true;
- }
- }
- if(false == found_npc)
- {
- return false;
- }
- end_index = this->item.size();
- for(i = 0; i < end_index; ++i)
- {
- need_vnum = this->item[i].vnum;
- need_count = this->item[i].count;
- if(false == FN_check_item_count(items, need_vnum, need_count))
- {
- return false;
- }
- }
- return true;
- }
- CUBE_VALUE* CUBE_DATA::reward_value()
- {
- int end_index = 0;
- DWORD reward_index = 0;
- end_index = this->reward.size();
- reward_index = number(0, end_index);
- reward_index = number(0, end_index - 1);
- return &this->reward[reward_index];
- }
- void CUBE_DATA::remove_material(LPCHARACTER ch)
- {
- DWORD i, end_index;
- DWORD need_vnum;
- int need_count;
- LPITEM* items = ch->GetCubeItem();
- end_index = this->item.size();
- for(i = 0; i < end_index; ++i)
- {
- need_vnum = this->item[i].vnum;
- need_count = this->item[i].count;
- FN_remove_material(items, need_vnum, need_count);
- }
- }
- void Cube_clean_item(LPCHARACTER ch)
- {
- LPITEM* cube_item;
- cube_item = ch->GetCubeItem();
- for(int i = 0; i < CUBE_MAX_NUM; ++i)
- {
- if(NULL == cube_item[i])
- {
- continue;
- }
- cube_item[i] = NULL;
- }
- }
- void Cube_open(LPCHARACTER ch)
- {
- if(false == s_isInitializedCubeMaterialInformation)
- {
- Cube_InformationInitialize();
- }
- if(NULL == ch)
- {
- return;
- }
- LPCHARACTER npc;
- npc = ch->GetQuestNPC();
- if(NULL == npc)
- {
- return;
- }
- if(FN_check_valid_npc(npc->GetRaceNum()) == false)
- {
- return;
- }
- if(ch->IsCubeOpen())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이미 제조창이 열려있습니다."));
- return;
- }
- if(ch->GetExchange() || ch->GetMyShop() || ch->GetShopOwner() || ch->IsOpenSafebox() || ch->IsCubeOpen())
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("다른 거래중(창고,교환,상점)에는 사용할 수 없습니다."));
- return;
- }
- long distance = DISTANCE_APPROX(ch->GetX() - npc->GetX(), ch->GetY() - npc->GetY());
- if(distance >= CUBE_MAX_DISTANCE)
- {
- sys_log(1, "CUBE: TOO_FAR: %s distance %d", ch->GetName(), distance);
- return;
- }
- Cube_clean_item(ch);
- ch->SetCubeNpc(npc);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube open %d", npc->GetRaceNum());
- }
- void Cube_close(LPCHARACTER ch)
- {
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- Cube_clean_item(ch);
- ch->SetCubeNpc(NULL);
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube close");
- }
- void Cube_init()
- {
- CUBE_DATA* p_cube = NULL;
- char file_name[256 + 1];
- snprintf(file_name, sizeof(file_name), "%s/cube.txt", LocaleService_GetBasePath().c_str());
- sys_log(0, "Cube_Init %s", file_name);
- for(auto iter = s_cube_proto.begin(); iter != s_cube_proto.end(); iter++)
- {
- p_cube = *iter;
- M2_DELETE(p_cube);
- }
- s_cube_proto.clear();
- if(false == Cube_load(file_name))
- {
- sys_err("Cube_Init failed");
- }
- }
- bool Cube_load(const char* file)
- {
- FILE* fp;
- char one_line[256];
- int value1, value2;
- const char* delim = " \t\r\n";
- char* v, *token_string;
- CUBE_DATA* cube_data = NULL;
- CUBE_VALUE cube_value = {0, 0};
- if(0 == file || 0 == file[0])
- {
- return false;
- }
- if((fp = fopen(file, "r")) == 0)
- {
- return false;
- }
- while(fgets(one_line, 256, fp))
- {
- value1 = value2 = 0;
- if(one_line[0] == '#')
- {
- continue;
- }
- token_string = strtok(one_line, delim);
- if(NULL == token_string)
- {
- continue;
- }
- if((v = strtok(NULL, delim)))
- {
- str_to_number(value1, v);
- }
- if((v = strtok(NULL, delim)))
- {
- str_to_number(value2, v);
- }
- TOKEN("section")
- {
- cube_data = M2_NEW CUBE_DATA;
- }
- else TOKEN("npc")
- {
- cube_data->npc_vnum.push_back((WORD) value1);
- }
- else TOKEN("item")
- {
- cube_value.vnum = value1;
- cube_value.count = value2;
- cube_data->item.push_back(cube_value);
- }
- else TOKEN("reward")
- {
- cube_value.vnum = value1;
- cube_value.count = value2;
- cube_data->reward.push_back(cube_value);
- }
- else TOKEN("percent")
- {
- cube_data->percent = value1;
- }
- else TOKEN("gold")
- {
- cube_data->gold = value1;
- }
- #ifdef ENABLE_CUBE_RENEWAL
- else TOKEN("allow_copy")
- {
- cube_data->allowCopyAttr = (value1 == 1 ? true : false);
- }
- #endif
- else TOKEN("end")
- {
- if(false == FN_check_cube_data(cube_data))
- {
- M2_DELETE(cube_data);
- continue;
- }
- s_cube_proto.push_back(cube_data);
- }
- }
- fclose(fp);
- return true;
- }
- static bool FN_update_cube_status(LPCHARACTER ch)
- {
- if(NULL == ch)
- {
- return false;
- }
- if(!ch->IsCubeOpen())
- {
- return false;
- }
- LPCHARACTER npc = ch->GetQuestNPC();
- if(NULL == npc)
- {
- return false;
- }
- CUBE_DATA* cube = FN_find_cube(ch->GetCubeItem(), npc->GetRaceNum());
- if(NULL == cube)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube info 0 0 0");
- return false;
- }
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube info %d %d %d", cube->gold, 0, 0);
- return true;
- }
- bool Cube_make(LPCHARACTER ch)
- {
- LPCHARACTER npc;
- int percent_number = 0;
- CUBE_DATA* cube_proto;
- LPITEM* items;
- LPITEM new_item;
- #ifdef ENABLE_CUBE_RENEWAL
- DWORD copyAttr[ITEM_ATTRIBUTE_MAX_NUM][2];
- long copySockets[ITEM_SOCKET_MAX_NUM];
- #endif
- if(!(ch)->IsCubeOpen())
- {
- (ch)->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("제조창이 열려있지 않습니다"));
- return false;
- }
- npc = ch->GetQuestNPC();
- if(NULL == npc)
- {
- return false;
- }
- items = ch->GetCubeItem();
- cube_proto = FN_find_cube(items, npc->GetRaceNum());
- if(NULL == cube_proto)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("제조 재료가 부족합니다"));
- return false;
- }
- int cube_gold = cube_proto->gold;
- if(cube_gold < 0 || ch->GetGold() < cube_gold)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("돈이 부족하거나 아이템이 제자리에 없습니다."));
- return false;
- }
- CUBE_VALUE* reward_value = cube_proto->reward_value();
- cube_proto->remove_material(ch);
- #ifdef ENABLE_CUBE_RENEWAL
- for (int i=0; i<CUBE_MAX_NUM; ++i)
- {
- if (NULL==items[i]) continue;
- if (items[i]->GetType() == ITEM_WEAPON || items[i]->GetType() == ITEM_ARMOR)
- {
- bool hasElement = false;
- for (int j = 0; j < cube_proto->item.size(); ++j)
- {
- if(cube_proto->item[j].vnum == items[i]->GetVnum())
- {
- hasElement = true;
- break;
- }
- }
- if(hasElement == false)
- continue;
- for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
- {
- copyAttr[a][0] = items[i]->GetAttributeType(a);
- copyAttr[a][1] = items[i]->GetAttributeValue(a);
- }
- //Copy Sockets
- for(int a = 0; a < items[i]->GetSocketCount(); a++)
- {
- copySockets[a] = items[i]->GetSocket(a);
- }
- break;
- }
- continue;
- }
- #endif
- if(0 < cube_proto->gold)
- {
- #ifndef ENABLE_YANG_LONGLONG
- ch->PointChange(POINT_GOLD, - (cube_proto->gold), false);
- #else
- ch->PointChange(POINT_GOLD, -static_cast<long long>(cube_proto->gold), false);
- #endif
- }
- percent_number = number(1, 100);
- if(percent_number <= cube_proto->percent)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube success %d %d", reward_value->vnum, reward_value->count);
- new_item = ch->AutoGiveItem(reward_value->vnum, reward_value->count);
- return true;
- #ifdef ENABLE_CUBE_RENEWAL
- if (cube_proto->allowCopyAttr == true && copyAttr != NULL)
- {
- new_item->ClearAttribute();
- for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
- {
- new_item->SetForceAttribute(a, copyAttr[a][0], copyAttr[a][1]);
- }
- for (int a = 0; a < ITEM_SOCKET_MAX_NUM; a++)
- {
- if(copySockets[a]){
- new_item->AddSocket();
- new_item->SetSocket(a, copySockets[a]);
- }
- }
- }
- #endif
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("제조에 실패하였습니다."));
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube fail");
- LogManager::instance().CubeLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), reward_value->vnum, 0, 0, 0);
- return false;
- }
- return false;
- }
- void Cube_show_list(LPCHARACTER ch)
- {
- LPITEM* cube_item;
- LPITEM item;
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- cube_item = ch->GetCubeItem();
- for(int i = 0; i < CUBE_MAX_NUM; ++i)
- {
- item = cube_item[i];
- if(NULL == item)
- {
- continue;
- }
- ch->ChatPacket(CHAT_TYPE_INFO, "cube[%d]: inventory[%d]: %s", i, item->GetCell(), item->GetName());
- }
- }
- void Cube_add_item(LPCHARACTER ch, int cube_index, int inven_index)
- {
- LPITEM item;
- LPITEM* cube_item;
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- if(inven_index < 0 || INVENTORY_MAX_NUM <= inven_index)
- {
- return;
- }
- if(cube_index < 0 || CUBE_MAX_NUM <= cube_index)
- {
- return;
- }
- item = ch->GetInventoryItem(inven_index);
- if(NULL == item)
- {
- return;
- }
- cube_item = ch->GetCubeItem();
- for(int i = 0; i < CUBE_MAX_NUM; ++i)
- {
- if(item == cube_item[i])
- {
- cube_item[i] = NULL;
- break;
- }
- }
- cube_item[cube_index] = item;
- if(test_server)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "cube[%d]: inventory[%d]: %s added", cube_index, inven_index, item->GetName());
- }
- FN_update_cube_status(ch);
- return;
- }
- void Cube_delete_item(LPCHARACTER ch, int cube_index)
- {
- LPITEM item;
- LPITEM* cube_item;
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- if(cube_index < 0 || CUBE_MAX_NUM <= cube_index)
- {
- return;
- }
- cube_item = ch->GetCubeItem();
- if(NULL == cube_item[cube_index])
- {
- return;
- }
- item = cube_item[cube_index];
- cube_item[cube_index] = NULL;
- if(test_server)
- {
- ch->ChatPacket(CHAT_TYPE_INFO, "cube[%d]: cube[%d]: %s deleted", cube_index, item->GetCell(), item->GetName());
- }
- FN_update_cube_status(ch);
- return;
- }
- SItemNameAndLevel SplitItemNameAndLevelFromName(const std::string& name)
- {
- int level = 0;
- SItemNameAndLevel info;
- info.name = name;
- size_t pos = name.find("+");
- if(std::string::npos != pos)
- {
- const std::string levelStr = name.substr(pos + 1, name.size() - pos - 1);
- str_to_number(level, levelStr.c_str());
- info.name = name.substr(0, pos);
- }
- info.level = level;
- return info;
- };
- bool FIsEqualCubeValue(const CUBE_VALUE& a, const CUBE_VALUE& b)
- {
- return (a.vnum == b.vnum) && (a.count == b.count);
- }
- bool FIsLessCubeValue(const CUBE_VALUE& a, const CUBE_VALUE& b)
- {
- return a.vnum < b.vnum;
- }
- void Cube_MakeCubeInformationText()
- {
- for(auto iter = cube_info_map.begin(); cube_info_map.end() != iter; ++iter)
- {
- TCubeResultList& resultList = iter->second;
- for(auto resultIter = resultList.begin(); resultList.end() != resultIter; ++resultIter)
- {
- SCubeMaterialInfo& materialInfo = *resultIter;
- std::string& infoText = materialInfo.infoText;
- if(0 < materialInfo.complicateMaterial.size())
- {
- std::sort(materialInfo.complicateMaterial.begin(), materialInfo.complicateMaterial.end(), FIsLessCubeValue);
- std::sort(materialInfo.material.begin(), materialInfo.material.end(), FIsLessCubeValue);
- for(auto iter = materialInfo.complicateMaterial.begin(); materialInfo.complicateMaterial.end() != iter; ++iter)
- {
- for(auto targetIter = materialInfo.material.begin(); materialInfo.material.end() != targetIter; ++targetIter)
- {
- if(*targetIter == *iter)
- {
- targetIter = materialInfo.material.erase(targetIter);
- }
- }
- }
- for(auto iter = materialInfo.complicateMaterial.begin(); materialInfo.complicateMaterial.end() != iter; ++iter)
- {
- char tempBuffer[128];
- sprintf(tempBuffer, "%d,%d|", iter->vnum, iter->count);
- infoText += std::string(tempBuffer);
- }
- infoText.erase(infoText.size() - 1);
- if(0 < materialInfo.material.size())
- {
- infoText.push_back('&');
- }
- }
- for(auto iter = materialInfo.material.begin(); materialInfo.material.end() != iter; ++iter)
- {
- char tempBuffer[128];
- sprintf(tempBuffer, "%d,%d&", iter->vnum, iter->count);
- infoText += std::string(tempBuffer);
- }
- infoText.erase(infoText.size() - 1);
- if(0 < materialInfo.gold)
- {
- char temp[128];
- sprintf(temp, "%d", materialInfo.gold);
- infoText += std::string("/") + temp;
- }
- }
- }
- }
- bool Cube_InformationInitialize()
- {
- for(size_t i = 0; i < s_cube_proto.size(); ++i)
- {
- CUBE_DATA* cubeData = s_cube_proto[i];
- const std::vector<CUBE_VALUE>& rewards = cubeData->reward;
- if(1 != rewards.size())
- {
- sys_err("[CubeInfo] WARNING! Does not support multiple rewards (count: %d)", rewards.size());
- continue;
- }
- const CUBE_VALUE& reward = rewards.at(0);
- const WORD& npcVNUM = cubeData->npc_vnum.at(0);
- bool bComplicate = false;
- TCubeMapByNPC& cubeMap = cube_info_map;
- TCubeResultList& resultList = cubeMap[npcVNUM];
- SCubeMaterialInfo materialInfo;
- materialInfo.reward = reward;
- materialInfo.gold = cubeData->gold;
- materialInfo.material = cubeData->item;
- for(auto iter = resultList.begin(); resultList.end() != iter; ++iter)
- {
- SCubeMaterialInfo& existInfo = *iter;
- if(reward.vnum == existInfo.reward.vnum)
- {
- for(auto existMaterialIter = existInfo.material.begin(); existInfo.material.end() != existMaterialIter; ++existMaterialIter)
- {
- TItemTable* existMaterialProto = ITEM_MANAGER::Instance().GetTable(existMaterialIter->vnum);
- SItemNameAndLevel existItemInfo = SplitItemNameAndLevelFromName(existMaterialProto->szName);
- if(0 < existItemInfo.level)
- {
- for(auto currentMaterialIter = materialInfo.material.begin(); materialInfo.material.end() != currentMaterialIter; ++currentMaterialIter)
- {
- TItemTable* currentMaterialProto = ITEM_MANAGER::Instance().GetTable(currentMaterialIter->vnum);
- SItemNameAndLevel currentItemInfo = SplitItemNameAndLevelFromName(currentMaterialProto->szName);
- if(currentItemInfo.name == existItemInfo.name)
- {
- bComplicate = true;
- existInfo.complicateMaterial.push_back(*currentMaterialIter);
- if(std::find(existInfo.complicateMaterial.begin(), existInfo.complicateMaterial.end(), *existMaterialIter) == existInfo.complicateMaterial.end())
- {
- existInfo.complicateMaterial.push_back(*existMaterialIter);
- }
- break;
- }
- }
- }
- }
- }
- }
- if(false == bComplicate)
- {
- resultList.push_back(materialInfo);
- }
- }
- Cube_MakeCubeInformationText();
- s_isInitializedCubeMaterialInformation = true;
- return true;
- }
- void Cube_request_result_list(LPCHARACTER ch)
- {
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- LPCHARACTER npc = ch->GetQuestNPC();
- if(NULL == npc)
- {
- return;
- }
- DWORD npcVNUM = npc->GetRaceNum();
- if(!FN_check_valid_npc(npcVNUM))
- {
- return;
- }
- size_t resultCount = 0;
- std::string& resultText = cube_result_info_map_by_npc[npcVNUM];
- if(resultText.length() == 0)
- {
- resultText.clear();
- const TCubeResultList& resultList = cube_info_map[npcVNUM];
- for(auto iter = resultList.begin(); resultList.end() != iter; ++iter)
- {
- const SCubeMaterialInfo& materialInfo = *iter;
- char temp[128];
- sprintf(temp, "%d,%d", materialInfo.reward.vnum, materialInfo.reward.count);
- resultText += std::string(temp) + "/";
- }
- resultCount = resultList.size();
- if(resultText.size() != 0)
- {
- resultText.erase(resultText.size() - 1);
- }
- int resultsize = (resultText.size() < 20) ? (20 - resultText.size()) : (resultText.size() - 20);
- if (resultsize >= CHAT_MAX_LEN)
- {
- sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, resultsize: %d, length: %d)", npcVNUM, resultsize, resultText.size());
- resultText.clear();
- resultCount = 0;
- }
- }
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube r_list %d %d %s", npcVNUM, resultCount, resultText.c_str());
- }
- void Cube_request_material_info(LPCHARACTER ch, int requestStartIndex, int requestCount)
- {
- RETURN_IF_CUBE_IS_NOT_OPENED(ch);
- LPCHARACTER npc = ch->GetQuestNPC();
- if(NULL == npc)
- {
- return;
- }
- DWORD npcVNUM = npc->GetRaceNum();
- if(!FN_check_valid_npc(npcVNUM))
- {
- return;
- }
- std::string materialInfoText = "";
- int index = 0;
- bool bCatchInfo = false;
- const TCubeResultList& resultList = cube_info_map[npcVNUM];
- for(auto iter = resultList.begin(); resultList.end() != iter; ++iter)
- {
- const SCubeMaterialInfo& materialInfo = *iter;
- if(index++ == requestStartIndex)
- {
- bCatchInfo = true;
- }
- if(bCatchInfo)
- {
- materialInfoText += materialInfo.infoText + "@";
- }
- if(index >= requestStartIndex + requestCount)
- {
- break;
- }
- }
- if(false == bCatchInfo)
- {
- sys_err("[CubeInfo] Can't find matched material info (NPC: %d, index: %d, request count: %d)", npcVNUM, requestStartIndex, requestCount);
- return;
- }
- if(materialInfoText.size() != 0)
- {
- materialInfoText.erase(materialInfoText.size() - 1);
- }
- if(materialInfoText.size() - 20 >= CHAT_MAX_LEN)
- {
- // sys_err("[CubeInfo] Too long material info. (NPC: %d, requestStart: %d, requestCount: %d, length: %d)", npcVNUM, requestStartIndex, requestCount, materialInfoText.size());
- }
- ch->ChatPacket(CHAT_TYPE_COMMAND, "cube m_info %d %d %s", requestStartIndex, requestCount, materialInfoText.c_str());
- }
Cube.h
Code- #pragma once
- #define CUBE_MAX_NUM 24
- #define CUBE_MAX_DISTANCE 1000
- struct CUBE_VALUE
- {
- DWORD vnum;
- int count;
- bool operator== (const CUBE_VALUE& b)
- {
- return (this->count == b.count) && (this->vnum == b.vnum);
- }
- };
- struct CUBE_DATA
- {
- std::vector<WORD> npc_vnum;
- std::vector<CUBE_VALUE> item;
- std::vector<CUBE_VALUE> reward;
- int percent;
- unsigned int gold;
- CUBE_DATA();
- #ifdef ENABLE_CUBE_RENEWAL
- bool allowCopyAttr;
- #endif
- bool can_make_item(LPITEM* items, WORD npc_vnum);
- CUBE_VALUE* reward_value();
- void remove_material(LPCHARACTER ch);
- };
- void Cube_init();
- bool Cube_load(const char* file);
- bool Cube_make(LPCHARACTER ch);
- void Cube_clean_item(LPCHARACTER ch);
- void Cube_open(LPCHARACTER ch);
- void Cube_close(LPCHARACTER ch);
- void Cube_show_list(LPCHARACTER ch);
- void Cube_add_item(LPCHARACTER ch, int cube_index, int inven_index);
- void Cube_delete_item(LPCHARACTER ch, int cube_index);
- void Cube_request_result_list(LPCHARACTER ch);
- void Cube_request_material_info(LPCHARACTER ch, int request_start_index, int request_count = 1);
- bool Cube_InformationInitialize();
Könnte jemand Bitte mal drüber schauen und sagen was eventuell da falsch ist
-
Bitte melden Sie sich an, um diesen Link zu sehen.
Unten das Bild bei den Lieben Dark
-
Guten Tag
ich hab auf Shirana-Online mal reingeschaut und die haben ein mega geiles Blaues Aura Shining ich Wollte mal fragen wie ich dies machen kann das mein Aura Shining auch so aussieht
-
ok danke dafür denn war es nur ein denk fehler von mir , werde es aber auch im Source reglen ist besser
-
ja maximal level ist 150.
und man sollte bei bossen und metin steine alles noch bis 150 droppen können sprich das man alles erreichen kann ohne ein farmer zu erstellen
-
Guten Tag
Ich hab eine Frage zu der Mob_drop_item.txt
Undzwar: ich möchte zB an einem 35ger metin mit level 150 immer noch etwas droppen ohne das level des metins zu verändern .
Nun hab ich dies in der Mob_drop_item.txt eingebau :
Diese Variante funktioniert aber nicht weil ich oben über mob den befehl : Type drop rausgenommen hab.
Nehme ich aber Type drop raus haben die metin steine keine dropps mehr eingestellt
Meine frage ist wie kann ich das einstellen das die Metins ein Level limit haben und dabei noch was droppen
-
Emin 11 hat mir geholfen viel lieben dank !
-
Bitte um Hilfe entweder es funktioniert nicht oder client geht nicht auf was mach ich falsch hier meine game :
Code- import os
- import app
- import dbg
- import grp
- import item
- import background
- import chr
- import chrmgr
- import player
- import snd
- import chat
- import textTail
- import snd
- import net
- import effect
- import wndMgr
- import fly
- import systemSetting
- import quest
- import guild
- import skill
- import messenger
- import localeInfo
- import constInfo
- import exchange
- import ime
- import day
- import uianyshop
- import uisidebar
- import event
- import uifastequip
- import time
- from switchbot import Bot
- import ui
- import uiCommon
- import uiPhaseCurtain
- import uiMapNameShower
- import uiAffectShower
- import uiPlayerGauge
- import uiCharacter
- import uiTarget
- import uiPrivateShopBuilder
- import mouseModule
- import consoleModule
- import playerSettingModule
- import interfaceModule
- import uiteleport
- import musicInfo
- import debugInfo
- import stringCommander
- import locale
- from _weakref import proxy
- SCREENSHOT_CWDSAVE = TRUE
- SCREENSHOT_DIR = None
- cameraDistance = 1550.0
- cameraPitch = 27.0
- cameraRotation = 0.0
- cameraHeight = 100.0
- class GameWindow(ui.ScriptWindow):
- def __init__(self, stream):
- ui.ScriptWindow.__init__(self, "GAME")
- self.SetWindowName("game")
- net.SetPhaseWindow(net.PHASE_WINDOW_GAME, self)
- player.SetGameWindow(self)
- day.nacht = 0
- day.tag = 0
- self.quickSlotPageIndex = 0
- self.lastPKModeSendedTime = 0
- self.pressNumber = None
- self.EQ = uifastequip.changeequip()
- self.guildWarQuestionDialog = None
- self.interface = None
- self.targetBoard = None
- self.console = None
- self.mapNameShower = None
- self.affectShower = None
- self.playerGauge = None
- self.switchbot = Bot()
- self.switchbot.Hide()
- self.uinewshopCreate = None
- self.uinewshop = None
- self.stream=stream
- self.interface = interfaceModule.Interface()
- self.interface.MakeInterface()
- self.interface.ShowDefaultWindows()
- self.curtain = uiPhaseCurtain.PhaseCurtain()
- self.curtain.speed = 0.03
- self.curtain.Hide()
- self.targetBoard = uiTarget.TargetBoard()
- self.targetBoard.SetWhisperEvent(ui.__mem_func__(self.interface.OpenWhisperDialog))
- self.targetBoard.Hide()
- self.console = consoleModule.ConsoleWindow()
- self.console.BindGameClass(self)
- self.console.SetConsoleSize(wndMgr.GetScreenWidth(), 200)
- self.console.Hide()
- self.mapNameShower = uiMapNameShower.MapNameShower()
- self.affectShower = uiAffectShower.AffectShower()
- self.playerGauge = uiPlayerGauge.PlayerGauge(self)
- self.playerGauge.Hide()
- self.__SetQuickSlotMode()
- self.__ServerCommand_Build()
- self.__ProcessPreservedServerCommand()
- self.teleport = uiteleport.TeleportWindow()
- self.timeLine = ui.TextLine()
- self.timeLine.SetFontName(localeInfo.UI_DEF_FONT_LARGE)
- self.timeLine.SetFontColor( 255, 045, 0)
- self.timeLine.SetPosition((wndMgr.GetScreenWidth() - 130) / 2, 180)
- constInfo.ANYSHOP_CONFIG["GUI"] = uianyshop.AnyShop()
- self.sideBar = uisidebar.SideBar()
- self.sideBar.Show()
- self.sideBar.AddButton("PvP Rangliste", self.__TogglePVPRankingWindow)
- self.sideBar.AddButton("EQ-Changer", self.__FastEQ)
- self.sideBar.AddButton("Channelwechsel", self.Channelswitcher)
- self.sideBar.AddButton("Switchbot", self.Switchbot)
- self.sideBar.AddButton("Yang-Anzeige", self.__nopickInfo)
- self.sideBar.AddButton("Gildenlager", self.__Gildenlager)
- self.sideBar.AddButton("Teleporter", self.karte.Open())
- #self.sideBar.AddButton("FB-Lager", self.ToggleSkilbookInventory)
- #self.sideBar.AddButton("Lager", self.__Lager)
- def __del__(self):
- player.SetGameWindow(0)
- net.ClearPhaseWindow(net.PHASE_WINDOW_GAME, self)
- ui.ScriptWindow.__del__(self)
- def Open(self):
- app.SetFrameSkip(1)
- import uinewshop
- self.uinewshop = uinewshop.ShopDialog()
- self.uinewshop.Close()
- self.uinewshopCreate = uinewshop.ShopDialogCreate()
- self.uinewshopCreate.Hide()
- self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
- self.quickSlotPageIndex = 0
- self.PickingCharacterIndex = -1
- self.PickingItemIndex = -1
- self.consoleEnable = FALSE
- self.isShowDebugInfo = FALSE
- self.ShowNameFlag = FALSE
- self.enableXMasBoom = FALSE
- self.startTimeXMasBoom = 0.0
- self.indexXMasBoom = 0
- global cameraDistance, cameraPitch, cameraRotation, cameraHeight
- app.SetCamera(cameraDistance, cameraPitch, cameraRotation, cameraHeight)
- constInfo.SET_DEFAULT_CAMERA_MAX_DISTANCE()
- constInfo.SET_DEFAULT_CHRNAME_COLOR()
- constInfo.SET_DEFAULT_FOG_LEVEL()
- constInfo.SET_DEFAULT_CONVERT_EMPIRE_LANGUAGE_ENABLE()
- constInfo.SET_DEFAULT_USE_ITEM_WEAPON_TABLE_ATTACK_BONUS()
- constInfo.SET_DEFAULT_USE_SKILL_EFFECT_ENABLE()
- constInfo.SET_TWO_HANDED_WEAPON_ATT_SPEED_DECREASE_VALUE()
- import event
- event.SetLeftTimeString(localeInfo.UI_LEFT_TIME)
- textTail.EnablePKTitle(constInfo.PVPMODE_ENABLE)
- self.__BuildKeyDict()
- self.__BuildDebugInfo()
- uiPrivateShopBuilder.Clear()
- exchange.InitTrading()
- if debugInfo.IsDebugMode():
- self.ToggleDebugInfo()
- snd.SetMusicVolume(systemSetting.GetMusicVolume()*net.GetFieldMusicVolume())
- snd.SetSoundVolume(systemSetting.GetSoundVolume())
- netFieldMusicFileName = net.GetFieldMusicFileName()
- if netFieldMusicFileName:
- snd.FadeInMusic("BGM/" + netFieldMusicFileName)
- elif musicInfo.fieldMusic != "":
- snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
- self.__SetQuickSlotMode()
- self.__SelectQuickPage(self.quickSlotPageIndex)
- self.SetFocus()
- self.Show()
- app.ShowCursor()
- net.SendEnterGamePacket()
- try:
- self.StartGame()
- except:
- import exception
- exception.Abort("GameWindow.Open")
- self.cubeInformation = {}
- self.currentCubeNPC = 0
- def Close(self):
- self.uinewshop.Hide()
- self.uinewshopCreate.Hide()
- uiPrivateShopBuilder.Clear()
- self.Hide()
- global cameraDistance, cameraPitch, cameraRotation, cameraHeight
- (cameraDistance, cameraPitch, cameraRotation, cameraHeight) = app.GetCamera()
- if musicInfo.fieldMusic != "":
- snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)
- self.onPressKeyDict = None
- self.onClickKeyDict = None
- chat.Close()
- snd.StopAllSound()
- grp.InitScreenEffect()
- chr.Destroy()
- textTail.Clear()
- quest.Clear()
- background.Destroy()
- guild.Destroy()
- messenger.Destroy()
- skill.ClearSkillData()
- wndMgr.Unlock()
- mouseModule.mouseController.DeattachObject()
- if self.guildWarQuestionDialog:
- self.guildWarQuestionDialog.Close()
- self.guildNameBoard = None
- self.partyRequestQuestionDialog = None
- self.partyInviteQuestionDialog = None
- self.guildInviteQuestionDialog = None
- self.guildWarQuestionDialog = None
- self.messengerAddFriendQuestion = None
- self.itemDropQuestionDialog = None
- self.confirmDialog = None
- self.PrintCoord = None
- self.FrameRate = None
- self.Pitch = None
- self.Splat = None
- self.TextureNum = None
- self.ObjectNum = None
- self.ViewDistance = None
- self.PrintMousePos = None
- self.ClearDictionary()
- self.playerGauge = None
- self.mapNameShower = None
- self.affectShower = None
- if self.console:
- self.console.BindGameClass(0)
- self.console.Close()
- self.console=None
- if self.targetBoard:
- self.targetBoard.Destroy()
- self.targetBoard = None
- if self.interface:
- self.interface.HideAllWindows()
- self.interface.Close()
- self.interface=None
- player.ClearSkillDict()
- player.ResetCameraRotation()
- self.KillFocus()
- app.HideCursor()
- if constInfo.ANYSHOP_CONFIG["GUI"].IsShow():
- constInfo.ANYSHOP_CONFIG["GUI"].Open()
- self.sideBar.Destroy()
- self.sideBar = None
- def __BuildKeyDict(self):
- onPressKeyDict = {}
- onPressKeyDict[app.DIK_1] = lambda : self.__PressNumKey(1)
- onPressKeyDict[app.DIK_2] = lambda : self.__PressNumKey(2)
- onPressKeyDict[app.DIK_3] = lambda : self.__PressNumKey(3)
- onPressKeyDict[app.DIK_4] = lambda : self.__PressNumKey(4)
- onPressKeyDict[app.DIK_5] = lambda : self.__PressNumKey(5)
- onPressKeyDict[app.DIK_6] = lambda : self.__PressNumKey(6)
- onPressKeyDict[app.DIK_7] = lambda : self.__PressNumKey(7)
- onPressKeyDict[app.DIK_8] = lambda : self.__PressNumKey(8)
- onPressKeyDict[app.DIK_9] = lambda : self.__PressNumKey(9)
- onPressKeyDict[app.DIK_F1] = lambda : self.__PressQuickSlot(4)
- onPressKeyDict[app.DIK_F2] = lambda : self.__PressQuickSlot(5)
- onPressKeyDict[app.DIK_F3] = lambda : self.__PressQuickSlot(6)
- onPressKeyDict[app.DIK_F4] = lambda : self.__PressQuickSlot(7)
- onPressKeyDict[app.DIK_LALT] = lambda : self.ShowName()
- onPressKeyDict[app.DIK_LCONTROL] = lambda : self.ShowMouseImage()
- onPressKeyDict[app.DIK_SYSRQ] = lambda : self.SaveScreen()
- onPressKeyDict[app.DIK_SPACE] = lambda : self.StartAttack()
- onPressKeyDict[app.DIK_UP] = lambda : self.MoveUp()
- onPressKeyDict[app.DIK_DOWN] = lambda : self.MoveDown()
- onPressKeyDict[app.DIK_LEFT] = lambda : self.MoveLeft()
- onPressKeyDict[app.DIK_RIGHT] = lambda : self.MoveRight()
- onPressKeyDict[app.DIK_W] = lambda : self.MoveUp()
- onPressKeyDict[app.DIK_S] = lambda : self.MoveDown()
- onPressKeyDict[app.DIK_A] = lambda : self.MoveLeft()
- onPressKeyDict[app.DIK_D] = lambda : self.MoveRight()
- onPressKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_TO_POSITIVE)
- onPressKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_TO_NEGATIVE)
- onPressKeyDict[app.DIK_T] = lambda: app.PitchCamera(app.CAMERA_TO_NEGATIVE)
- onPressKeyDict[app.DIK_G] = self.__PressGKey
- onPressKeyDict[app.DIK_Q] = self.__PressQKey
- onPressKeyDict[app.DIK_NUMPAD9] = lambda: app.MovieResetCamera()
- onPressKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_TO_NEGATIVE)
- onPressKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_TO_POSITIVE)
- onPressKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_TO_NEGATIVE)
- onPressKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_TO_POSITIVE)
- onPressKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_TO_NEGATIVE)
- onPressKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_TO_POSITIVE)
- onPressKeyDict[app.DIK_GRAVE] = lambda : self.PickUpItem()
- onPressKeyDict[app.DIK_Z] = lambda : self.PickUpItem()
- onPressKeyDict[app.DIK_C] = lambda state = "STATUS": self.interface.ToggleCharacterWindow(state)
- onPressKeyDict[app.DIK_V] = lambda state = "SKILL": self.interface.ToggleCharacterWindow(state)
- onPressKeyDict[app.DIK_N] = lambda state = "QUEST": self.interface.ToggleCharacterWindow(state)
- onPressKeyDict[app.DIK_I] = lambda : self.interface.ToggleInventoryWindow()
- onPressKeyDict[app.DIK_O] = lambda : self.interface.ToggleDragonSoulWindowWithNoInfo()
- onPressKeyDict[app.DIK_M] = lambda : self.interface.PressMKey()
- onPressKeyDict[app.DIK_ADD] = lambda : self.interface.MiniMapScaleUp()
- onPressKeyDict[app.DIK_SUBTRACT] = lambda : self.interface.MiniMapScaleDown()
- onPressKeyDict[app.DIK_L] = lambda : self.interface.ToggleChatLogWindow()
- onPressKeyDict[app.DIK_COMMA] = lambda : self.ShowConsole()
- onPressKeyDict[app.DIK_LSHIFT] = lambda : self.__SetQuickPageMode()
- onPressKeyDict[app.DIK_H] = lambda : self.__PressHKey()
- onPressKeyDict[app.DIK_B] = lambda : self.__PressBKey()
- onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
- onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
- self.onPressKeyDict = onPressKeyDict
- onClickKeyDict = {}
- onClickKeyDict[app.DIK_UP] = lambda : self.StopUp()
- onClickKeyDict[app.DIK_DOWN] = lambda : self.StopDown()
- onClickKeyDict[app.DIK_LEFT] = lambda : self.StopLeft()
- onClickKeyDict[app.DIK_RIGHT] = lambda : self.StopRight()
- onClickKeyDict[app.DIK_SPACE] = lambda : self.EndAttack()
- onClickKeyDict[app.DIK_W] = lambda : self.StopUp()
- onClickKeyDict[app.DIK_S] = lambda : self.StopDown()
- onClickKeyDict[app.DIK_A] = lambda : self.StopLeft()
- onClickKeyDict[app.DIK_D] = lambda : self.StopRight()
- onClickKeyDict[app.DIK_Q] = lambda: app.RotateCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_E] = lambda: app.RotateCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_R] = lambda: app.ZoomCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_F] = lambda: app.ZoomCamera(app.CAMERA_STOP)
- # onClickKeyDict[app.DIK_T] = lambda: app.ZoomCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_T] = lambda: self.__ReleaseTKey()
- onClickKeyDict[app.DIK_G] = lambda: self.__ReleaseGKey()
- onClickKeyDict[app.DIK_NUMPAD4] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_NUMPAD6] = lambda: app.MovieRotateCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_PGUP] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_PGDN] = lambda: app.MovieZoomCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_NUMPAD8] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_NUMPAD2] = lambda: app.MoviePitchCamera(app.CAMERA_STOP)
- onClickKeyDict[app.DIK_LALT] = lambda: self.HideName()
- onClickKeyDict[app.DIK_LCONTROL] = lambda: self.HideMouseImage()
- onClickKeyDict[app.DIK_LSHIFT] = lambda: self.__SetQuickSlotMode()
- self.onClickKeyDict=onClickKeyDict
- def __PressNumKey(self,num):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- if num >= 1 and num <= 9:
- if(chrmgr.IsPossibleEmoticon(-1)):
- chrmgr.SetEmoticon(-1,int(num)-1)
- net.SendEmoticon(int(num)-1)
- else:
- if num >= 1 and num <= 4:
- self.pressNumber(num-1)
- def __ClickBKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- return
- else:
- if constInfo.PVPMODE_ACCELKEY_ENABLE:
- self.ChangePKMode()
- def __PressHKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- if player.IsMountingHorse():
- net.SendChatPacket("/unmount")
- else:
- if not uiPrivateShopBuilder.IsBuildingPrivateShop():
- for i in xrange(player.INVENTORY_PAGE_SIZE):
- if player.GetItemIndex(i) in (71114, 71116, 71118, 71120):
- net.SendItemUsePacket(i)
- break
- def __PressBKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- net.SendChatPacket("/user_horse_back")
- else:
- state = "EMOTICON"
- self.interface.ToggleCharacterWindow(state)
- def __PressFKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- net.SendChatPacket("/user_horse_feed")
- else:
- app.ZoomCamera(app.CAMERA_TO_POSITIVE)
- def __PressHKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- net.SendChatPacket("/ride")
- else:
- if self.ShowNameFlag:
- self.interface.ToggleGuildWindow()
- else:
- self.interface.OpenHelpWindow()
- def __PressGKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- net.SendChatPacket("/ride")
- else:
- if self.ShowNameFlag:
- self.interface.ToggleGuildWindow()
- else:
- app.PitchCamera(app.CAMERA_TO_POSITIVE)
- def __ReleaseGKey(self):
- app.PitchCamera(app.CAMERA_STOP)
- def __ReleaseTKey(self):
- app.PitchCamera(app.CAMERA_STOP)
- def __PressQKey(self):
- if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
- if 0==interfaceModule.IsQBHide:
- interfaceModule.IsQBHide = 1
- self.interface.HideAllQuestButton()
- else:
- interfaceModule.IsQBHide = 0
- self.interface.ShowAllQuestButton()
- else:
- app.RotateCamera(app.CAMERA_TO_NEGATIVE)
- def __SetQuickSlotMode(self):
- self.pressNumber=ui.__mem_func__(self.__PressQuickSlot)
- def __SetQuickPageMode(self):
- self.pressNumber=ui.__mem_func__(self.__SelectQuickPage)
- def __PressQuickSlot(self, localSlotIndex):
- player.RequestUseLocalQuickSlot(localSlotIndex)
- def __SelectQuickPage(self, pageIndex):
- self.quickSlotPageIndex = pageIndex
- player.SetQuickPage(pageIndex)
- def ToggleDebugInfo(self):
- self.isShowDebugInfo = not self.isShowDebugInfo
- if self.isShowDebugInfo:
- self.PrintCoord.Show()
- self.FrameRate.Show()
- self.Pitch.Show()
- self.Splat.Show()
- self.TextureNum.Show()
- self.ObjectNum.Show()
- self.ViewDistance.Show()
- self.PrintMousePos.Show()
- else:
- self.PrintCoord.Hide()
- self.FrameRate.Hide()
- self.Pitch.Hide()
- self.Splat.Hide()
- self.TextureNum.Hide()
- self.ObjectNum.Hide()
- self.ViewDistance.Hide()
- self.PrintMousePos.Hide()
- def __BuildDebugInfo(self):
- self.PrintCoord = ui.TextLine()
- self.PrintCoord.SetFontName(localeInfo.UI_DEF_FONT)
- self.PrintCoord.SetPosition(wndMgr.GetScreenWidth() - 270, 0)
- self.FrameRate = ui.TextLine()
- self.FrameRate.SetFontName(localeInfo.UI_DEF_FONT)
- self.FrameRate.SetPosition(wndMgr.GetScreenWidth() - 270, 20)
- self.Pitch = ui.TextLine()
- self.Pitch.SetFontName(localeInfo.UI_DEF_FONT)
- self.Pitch.SetPosition(wndMgr.GetScreenWidth() - 270, 40)
- self.Splat = ui.TextLine()
- self.Splat.SetFontName(localeInfo.UI_DEF_FONT)
- self.Splat.SetPosition(wndMgr.GetScreenWidth() - 270, 60)
- self.PrintMousePos = ui.TextLine()
- self.PrintMousePos.SetFontName(localeInfo.UI_DEF_FONT)
- self.PrintMousePos.SetPosition(wndMgr.GetScreenWidth() - 270, 80)
- self.TextureNum = ui.TextLine()
- self.TextureNum.SetFontName(localeInfo.UI_DEF_FONT)
- self.TextureNum.SetPosition(wndMgr.GetScreenWidth() - 270, 100)
- self.ObjectNum = ui.TextLine()
- self.ObjectNum.SetFontName(localeInfo.UI_DEF_FONT)
- self.ObjectNum.SetPosition(wndMgr.GetScreenWidth() - 270, 120)
- self.ViewDistance = ui.TextLine()
- self.ViewDistance.SetFontName(localeInfo.UI_DEF_FONT)
- self.ViewDistance.SetPosition(0, 0)
- self.timeLine.SetWindowHorizontalAlignCenter()
- self.timeLine.SetHorizontalAlignCenter()
- self.timeLine.SetFeather()
- self.timeLine.SetOutline()
- self.timeLine.Show()
- def __NotifyError(self, msg):
- chat.AppendChat(chat.CHAT_TYPE_INFO, msg)
- def ChangePKMode(self):
- if not app.IsPressed(app.DIK_LCONTROL):
- return
- if player.GetStatus(player.LEVEL)<constInfo.PVPMODE_PROTECTED_LEVEL:
- self.__NotifyError(localeInfo.OPTION_PVPMODE_PROTECT % (constInfo.PVPMODE_PROTECTED_LEVEL))
- return
- curTime = app.GetTime()
- if curTime - self.lastPKModeSendedTime < constInfo.PVPMODE_ACCELKEY_DELAY:
- return
- self.lastPKModeSendedTime = curTime
- curPKMode = player.GetPKMode()
- nextPKMode = curPKMode + 1
- if nextPKMode == player.PK_MODE_PROTECT:
- if 0 == player.GetGuildID():
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_CANNOT_SET_GUILD_MODE)
- nextPKMode = 0
- else:
- nextPKMode = player.PK_MODE_GUILD
- elif nextPKMode == player.PK_MODE_MAX_NUM:
- nextPKMode = 0
- net.SendChatPacket("/PKMode " + str(nextPKMode))
- print "/PKMode " + str(nextPKMode)
- def OnChangePKMode(self):
- self.interface.OnChangePKMode()
- try:
- self.__NotifyError(localeInfo.OPTION_PVPMODE_MESSAGE_DICT[player.GetPKMode()])
- except KeyError:
- print "UNKNOWN PVPMode[%d]" % (player.GetPKMode())
- def StartGame(self):
- self.RefreshInventory()
- self.RefreshEquipment()
- self.RefreshCharacter()
- self.RefreshSkill()
- self.RefreshAcce()
- def CheckGameButton(self):
- if self.interface:
- self.interface.CheckGameButton()
- def RefreshAlignment(self):
- self.interface.RefreshAlignment()
- def RefreshStatus(self):
- self.CheckGameButton()
- if self.interface:
- self.interface.RefreshStatus()
- if self.playerGauge:
- self.playerGauge.RefreshGauge()
- def RefreshStamina(self):
- self.interface.RefreshStamina()
- def RefreshSkill(self):
- self.CheckGameButton()
- if self.interface:
- self.interface.RefreshSkill()
- def RefreshQuest(self):
- self.interface.RefreshQuest()
- def RefreshMessenger(self):
- self.interface.RefreshMessenger()
- def RefreshGuildInfoPage(self):
- self.interface.RefreshGuildInfoPage()
- def RefreshGuildBoardPage(self):
- self.interface.RefreshGuildBoardPage()
- def RefreshGuildMemberPage(self):
- self.interface.RefreshGuildMemberPage()
- def RefreshGuildMemberPageGradeComboBox(self):
- self.interface.RefreshGuildMemberPageGradeComboBox()
- def RefreshGuildSkillPage(self):
- self.interface.RefreshGuildSkillPage()
- def RefreshGuildGradePage(self):
- self.interface.RefreshGuildGradePage()
- def OnBlockMode(self, mode):
- self.interface.OnBlockMode(mode)
- def OpenQuestWindow(self, skin, idx):
- if constInfo.CApiSetHide == 1:
- net.SendQuestInputStringPacket(str(constInfo.SendString))
- constInfo.CApiSetHide = 0
- return
- self.interface.OpenQuestWindow(skin, idx)
- def AskGuildName(self):
- guildNameBoard = uiCommon.InputDialog()
- guildNameBoard.SetTitle(localeInfo.GUILD_NAME)
- guildNameBoard.SetAcceptEvent(ui.__mem_func__(self.ConfirmGuildName))
- guildNameBoard.SetCancelEvent(ui.__mem_func__(self.CancelGuildName))
- guildNameBoard.Open()
- self.guildNameBoard = guildNameBoard
- def ConfirmGuildName(self):
- guildName = self.guildNameBoard.GetText()
- if not guildName:
- return
- if net.IsInsultIn(guildName):
- self.PopupMessage(localeInfo.GUILD_CREATE_ERROR_INSULT_NAME)
- return
- net.SendAnswerMakeGuildPacket(guildName)
- self.guildNameBoard.Close()
- self.guildNameBoard = None
- return TRUE
- def CancelGuildName(self):
- self.guildNameBoard.Close()
- self.guildNameBoard = None
- return TRUE
- def PopupMessage(self, msg):
- self.stream.popupWindow.Close()
- self.stream.popupWindow.Open(msg, 0, localeInfo.UI_OK)
- def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type=0):
- self.interface.OpenRefineDialog(targetItemPos, nextGradeItemVnum, cost, prob, type)
- def AppendMaterialToRefineDialog(self, vnum, count):
- self.interface.AppendMaterialToRefineDialog(vnum, count)
- def RunUseSkillEvent(self, slotIndex, coolTime):
- self.interface.OnUseSkill(slotIndex, coolTime)
- def ClearAffects(self):
- self.affectShower.ClearAffects()
- def SetAffect(self, affect):
- self.affectShower.SetAffect(affect)
- def ResetAffect(self, affect):
- self.affectShower.ResetAffect(affect)
- def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
- self.affectShower.BINARY_NEW_AddAffect(type, pointIdx, value, duration)
- if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
- self.interface.DragonSoulActivate(type - chr.NEW_AFFECT_DRAGON_SOUL_DECK1)
- elif chr.NEW_AFFECT_DRAGON_SOUL_QUALIFIED == type:
- self.BINARY_DragonSoulGiveQuilification()
- def BINARY_NEW_RemoveAffect(self, type, pointIdx):
- self.affectShower.BINARY_NEW_RemoveAffect(type, pointIdx)
- if chr.NEW_AFFECT_DRAGON_SOUL_DECK1 == type or chr.NEW_AFFECT_DRAGON_SOUL_DECK2 == type:
- self.interface.DragonSoulDeactivate()
- def ActivateSkillSlot(self, slotIndex):
- if self.interface:
- self.interface.OnActivateSkill(slotIndex)
- def DeactivateSkillSlot(self, slotIndex):
- if self.interface:
- self.interface.OnDeactivateSkill(slotIndex)
- def RefreshEquipment(self):
- if self.interface:
- self.interface.RefreshInventory()
- def RefreshInventory(self):
- if self.interface:
- self.interface.RefreshInventory()
- self.interface.RefreshAcce()
- def RefreshAcce(self):
- if self.interface:
- self.interface.RefreshAcce()
- def RefreshCharacter(self):
- if self.interface:
- self.interface.RefreshCharacter()
- def OnGameOver(self):
- self.CloseTargetBoard()
- self.OpenRestartDialog()
- def OpenRestartDialog(self):
- self.interface.OpenRestartDialog()
- def ChangeCurrentSkill(self, skillSlotNumber):
- self.interface.OnChangeCurrentSkill(skillSlotNumber)
- def SetPCTargetBoard(self, vid, name):
- if constInfo.GUILDSTORAGE["open"] == 1:
- return
- self.targetBoard.Open(vid, name)
- if app.IsPressed(app.DIK_LCONTROL):
- if not player.IsSameEmpire(vid):
- return
- if player.IsMainCharacterIndex(vid):
- return
- elif chr.INSTANCE_TYPE_BUILDING == chr.GetInstanceType(vid):
- return
- self.interface.OpenWhisperDialog(name)
- def RefreshTargetBoardByVID(self, vid):
- self.targetBoard.RefreshByVID(vid)
- def RefreshTargetBoardByName(self, name):
- self.targetBoard.RefreshByName(name)
- def __RefreshTargetBoard(self):
- self.targetBoard.Refresh()
- if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
- def SetHPTargetBoard(self, vid, hpPercentage, iMinHP, iMaxHP):
- if vid != self.targetBoard.GetTargetVID():
- self.targetBoard.ResetTargetBoard()
- self.targetBoard.SetEnemyVID(vid)
- self.targetBoard.SetHP(hpPercentage, iMinHP, iMaxHP)
- self.targetBoard.Show()
- else:
- def SetHPTargetBoard(self, vid, hpPercentage):
- if vid != self.targetBoard.GetTargetVID():
- self.targetBoard.ResetTargetBoard()
- self.targetBoard.SetEnemyVID(vid)
- self.targetBoard.SetHP(hpPercentage)
- self.targetBoard.Show()
- def CloseTargetBoardIfDifferent(self, vid):
- if vid != self.targetBoard.GetTargetVID():
- self.targetBoard.Close()
- def CloseTargetBoard(self):
- self.targetBoard.Close()
- def OpenEquipmentDialog(self, vid):
- self.interface.OpenEquipmentDialog(vid)
- def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
- self.interface.SetEquipmentDialogItem(vid, slotIndex, vnum, count)
- def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
- self.interface.SetEquipmentDialogSocket(vid, slotIndex, socketIndex, value)
- def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
- self.interface.SetEquipmentDialogAttr(vid, slotIndex, attrIndex, type, value)
- def ShowMapName(self, mapName, x, y):
- if self.mapNameShower:
- self.mapNameShower.ShowMapName(mapName, x, y)
- if self.interface:
- self.interface.SetMapName(mapName)
- def BINARY_OpenAtlasWindow(self):
- self.interface.BINARY_OpenAtlasWindow()
- def OnRecvWhisper(self, mode, name, line):
- if mode == chat.WHISPER_TYPE_GM:
- self.interface.RegisterGameMasterName(name)
- chat.AppendWhisper(mode, name, line)
- self.interface.RecvWhisper(name)
- def OnRecvWhisperSystemMessage(self, mode, name, line):
- chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line)
- self.interface.RecvWhisper(name)
- def OnRecvWhisperError(self, mode, name, line):
- if localeInfo.WHISPER_ERROR.has_key(mode):
- chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name))
- else:
- chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name))
- self.interface.RecvWhisper(name)
- def RecvWhisper(self, name):
- self.interface.RecvWhisper(name)
- def OnPickMoney(self, money):
- if constInfo.pickInfo == 1:
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_PICK_MONEY % localeInfo.NumberToMoneyString(money))
- else:
- return
- def OnShopError(self, type):
- try:
- self.PopupMessage(localeInfo.SHOP_ERROR_DICT[type])
- except KeyError:
- self.PopupMessage(localeInfo.SHOP_ERROR_UNKNOWN % (type))
- def OnSafeBoxError(self):
- self.PopupMessage(localeInfo.SAFEBOX_ERROR)
- def OnFishingSuccess(self, isFish, fishName):
- chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_SUCCESS(isFish, fishName), 2000)
- def OnFishingNotifyUnknown(self):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_UNKNOWN)
- def OnFishingWrongPlace(self):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_WRONG_PLACE)
- def OnFishingNotify(self, isFish, fishName):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.FISHING_NOTIFY(isFish, fishName))
- def OnFishingFailure(self):
- chat.AppendChatWithDelay(chat.CHAT_TYPE_INFO, localeInfo.FISHING_FAILURE, 2000)
- def OnCannotPickItem(self):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_PICK_ITEM)
- def OnCannotMining(self):
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GAME_CANNOT_MINING)
- def OnCannotUseSkill(self, vid, type):
- textTail.RegisterInfoTail(vid, localeInfo.USE_SKILL_ERROR_TAIL_DICT[type])
- def OnCannotShotError(self, vid, type):
- textTail.RegisterInfoTail(vid, localeInfo.SHOT_ERROR_TAIL_DICT.get(type, localeInfo.SHOT_ERROR_UNKNOWN % (type)))
- def StartPointReset(self):
- self.interface.OpenPointResetDialog()
- def StartShop(self, vid):
- if constInfo.GUILDSTORAGE["open"] == 1:
- return
- self.interface.OpenShopDialog(vid)
- def EndShop(self):
- self.interface.CloseShopDialog()
- def RefreshShop(self):
- self.interface.RefreshShopDialog()
- def SetShopSellingPrice(self, Price):
- pass
- def StartExchange(self):
- if constInfo.GUILDSTORAGE["open"] == 1:
- net.SendExchangeExitPacket()
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Du kannst nicht Handeln, solange das Gildenlager offen ist.")
- return
- self.interface.StartExchange()
- def EndExchange(self):
- self.interface.EndExchange()
- def RefreshExchange(self):
- self.interface.RefreshExchange()
- def RecvPartyInviteQuestion(self, leaderVID, leaderName):
- partyInviteQuestionDialog = uiCommon.QuestionDialog()
- partyInviteQuestionDialog.SetText(leaderName + localeInfo.PARTY_DO_YOU_JOIN)
- partyInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerPartyInvite(arg))
- partyInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerPartyInvite(arg))
- partyInviteQuestionDialog.Open()
- partyInviteQuestionDialog.partyLeaderVID = leaderVID
- self.partyInviteQuestionDialog = partyInviteQuestionDialog
- def AnswerPartyInvite(self, answer):
- if not self.partyInviteQuestionDialog:
- return
- partyLeaderVID = self.partyInviteQuestionDialog.partyLeaderVID
- distance = player.GetCharacterDistance(partyLeaderVID)
- if distance < 0.0 or distance > 5000:
- answer = FALSE
- net.SendPartyInviteAnswerPacket(partyLeaderVID, answer)
- self.partyInviteQuestionDialog.Close()
- self.partyInviteQuestionDialog = None
- def AddPartyMember(self, pid, name):
- self.interface.AddPartyMember(pid, name)
- def UpdatePartyMemberInfo(self, pid):
- self.interface.UpdatePartyMemberInfo(pid)
- def RemovePartyMember(self, pid):
- self.interface.RemovePartyMember(pid)
- self.__RefreshTargetBoard()
- def LinkPartyMember(self, pid, vid):
- self.interface.LinkPartyMember(pid, vid)
- def UnlinkPartyMember(self, pid):
- self.interface.UnlinkPartyMember(pid)
- def UnlinkAllPartyMember(self):
- self.interface.UnlinkAllPartyMember()
- def ExitParty(self):
- self.interface.ExitParty()
- self.RefreshTargetBoardByVID(self.targetBoard.GetTargetVID())
- def ChangePartyParameter(self, distributionMode):
- self.interface.ChangePartyParameter(distributionMode)
- def OnMessengerAddFriendQuestion(self, name):
- messengerAddFriendQuestion = uiCommon.QuestionDialog2()
- messengerAddFriendQuestion.SetText1(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_1 % (name))
- messengerAddFriendQuestion.SetText2(localeInfo.MESSENGER_DO_YOU_ACCEPT_ADD_FRIEND_2)
- messengerAddFriendQuestion.SetAcceptEvent(ui.__mem_func__(self.OnAcceptAddFriend))
- messengerAddFriendQuestion.SetCancelEvent(ui.__mem_func__(self.OnDenyAddFriend))
- messengerAddFriendQuestion.Open()
- messengerAddFriendQuestion.name = name
- self.messengerAddFriendQuestion = messengerAddFriendQuestion
- def OnAcceptAddFriend(self):
- name = self.messengerAddFriendQuestion.name
- net.SendChatPacket("/messenger_auth y " + name)
- self.OnCloseAddFriendQuestionDialog()
- return TRUE
- def OnDenyAddFriend(self):
- name = self.messengerAddFriendQuestion.name
- net.SendChatPacket("/messenger_auth n " + name)
- self.OnCloseAddFriendQuestionDialog()
- return TRUE
- def OnCloseAddFriendQuestionDialog(self):
- self.messengerAddFriendQuestion.Close()
- self.messengerAddFriendQuestion = None
- return TRUE
- def OpenSafeboxWindow(self, size):
- self.interface.OpenSafeboxWindow(size)
- def RefreshSafebox(self):
- self.interface.RefreshSafebox()
- def RefreshSafeboxMoney(self):
- self.interface.RefreshSafeboxMoney()
- def OpenMallWindow(self, size):
- self.interface.OpenMallWindow(size)
- def RefreshMall(self):
- self.interface.RefreshMall()
- def RecvGuildInviteQuestion(self, guildID, guildName):
- guildInviteQuestionDialog = uiCommon.QuestionDialog()
- guildInviteQuestionDialog.SetText(guildName + localeInfo.GUILD_DO_YOU_JOIN)
- guildInviteQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerGuildInvite(arg))
- guildInviteQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerGuildInvite(arg))
- guildInviteQuestionDialog.Open()
- guildInviteQuestionDialog.guildID = guildID
- self.guildInviteQuestionDialog = guildInviteQuestionDialog
- def AnswerGuildInvite(self, answer):
- if not self.guildInviteQuestionDialog:
- return
- guildLeaderVID = self.guildInviteQuestionDialog.guildID
- net.SendGuildInviteAnswerPacket(guildLeaderVID, answer)
- self.guildInviteQuestionDialog.Close()
- self.guildInviteQuestionDialog = None
- def DeleteGuild(self):
- self.interface.DeleteGuild()
- def ShowClock(self, second):
- self.interface.ShowClock(second)
- def HideClock(self):
- self.interface.HideClock()
- def BINARY_ActEmotion(self, emotionIndex):
- if self.interface.wndCharacter:
- self.interface.wndCharacter.ActEmotion(emotionIndex)
- def CheckFocus(self):
- if FALSE == self.IsFocus():
- if TRUE == self.interface.IsOpenChat():
- self.interface.ToggleChat()
- self.SetFocus()
- def SaveScreen(self):
- print "save screen"
- if SCREENSHOT_CWDSAVE:
- if not os.path.exists(os.getcwd()+os.sep+"screenshot"):
- os.mkdir(os.getcwd()+os.sep+"screenshot")
- (succeeded, name) = grp.SaveScreenShotToPath(os.getcwd()+os.sep+"screenshot"+os.sep)
- elif SCREENSHOT_DIR:
- (succeeded, name) = grp.SaveScreenShot(SCREENSHOT_DIR)
- else:
- (succeeded, name) = grp.SaveScreenShot()
- if succeeded:
- pass
- else:
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SCREENSHOT_SAVE_FAILURE)
- def ShowConsole(self):
- if debugInfo.IsDebugMode() or TRUE == self.consoleEnable:
- player.EndKeyWalkingImmediately()
- self.console.OpenWindow()
- def ShowName(self):
- self.ShowNameFlag = TRUE
- self.playerGauge.EnableShowAlways()
- player.SetQuickPage(self.quickSlotPageIndex+1)
- def __IsShowName(self):
- if systemSetting.IsAlwaysShowName():
- return TRUE
- if self.ShowNameFlag:
- return TRUE
- return FALSE
- def HideName(self):
- self.ShowNameFlag = FALSE
- self.playerGauge.DisableShowAlways()
- player.SetQuickPage(self.quickSlotPageIndex)
- def ShowMouseImage(self):
- self.interface.ShowMouseImage()
- def HideMouseImage(self):
- self.interface.HideMouseImage()
- def StartAttack(self):
- player.SetAttackKeyState(TRUE)
- def EndAttack(self):
- player.SetAttackKeyState(FALSE)
- def MoveUp(self):
- player.SetSingleDIKKeyState(app.DIK_UP, TRUE)
- def MoveDown(self):
- player.SetSingleDIKKeyState(app.DIK_DOWN, TRUE)
- def MoveLeft(self):
- player.SetSingleDIKKeyState(app.DIK_LEFT, TRUE)
- def MoveRight(self):
- player.SetSingleDIKKeyState(app.DIK_RIGHT, TRUE)
- def StopUp(self):
- player.SetSingleDIKKeyState(app.DIK_UP, FALSE)
- def StopDown(self):
- player.SetSingleDIKKeyState(app.DIK_DOWN, FALSE)
- def StopLeft(self):
- player.SetSingleDIKKeyState(app.DIK_LEFT, FALSE)
- def StopRight(self):
- player.SetSingleDIKKeyState(app.DIK_RIGHT, FALSE)
- def PickUpItem(self):
- player.PickCloseItem()
- def OnKeyDown(self, key):
- if self.interface.wndWeb and self.interface.wndWeb.IsShow():
- return
- if key == app.DIK_ESC:
- # self.RequestDropItem(FALSE)
- constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
- try:
- self.onPressKeyDict[key]()
- except KeyError:
- pass
- except:
- raise
- return TRUE
- def OnKeyUp(self, key):
- try:
- self.onClickKeyDict[key]()
- except KeyError:
- pass
- except:
- raise
- return TRUE
- def OnMouseLeftButtonDown(self):
- if self.interface.BUILD_OnMouseLeftButtonDown():
- return
- if mouseModule.mouseController.isAttached():
- self.CheckFocus()
- else:
- hyperlink = ui.GetHyperlink()
- if hyperlink:
- return
- else:
- self.CheckFocus()
- player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
- return TRUE
- def OnMouseLeftButtonUp(self):
- if self.interface.BUILD_OnMouseLeftButtonUp():
- return
- if mouseModule.mouseController.isAttached():
- attachedType = mouseModule.mouseController.GetAttachedType()
- attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
- attachedItemSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
- attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
- if player.SLOT_TYPE_QUICK_SLOT == attachedType:
- player.RequestDeleteGlobalQuickSlot(attachedItemSlotPos)
- elif player.SLOT_TYPE_INVENTORY == attachedType:
- if player.ITEM_MONEY == attachedItemIndex:
- self.__PutMoney(attachedType, attachedItemCount, self.PickingCharacterIndex)
- else:
- self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
- elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
- self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
- elif player.SLOT_TYPE_SKILLBOOK_INVENTORY == attachedType:
- self.__PutItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, self.PickingCharacterIndex)
- mouseModule.mouseController.DeattachObject()
- else:
- hyperlink = ui.GetHyperlink()
- if hyperlink:
- if app.IsPressed(app.DIK_LALT):
- link = chat.GetLinkFromHyperlink(hyperlink)
- ime.PasteString(link)
- else:
- self.interface.MakeHyperlinkTooltip(hyperlink)
- return
- else:
- player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
- return TRUE
- def __PutItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount, dstChrID):
- if player.SLOT_TYPE_INVENTORY == attachedType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType or player.SLOT_TYPE_SKILLBOOK_INVENTORY == attachedType:
- attachedInvenType = player.SlotTypeToInvenType(attachedType)
- if TRUE == chr.HasInstance(self.PickingCharacterIndex) and player.GetMainCharacterIndex() != dstChrID:
- if player.IsEquipmentSlot(attachedItemSlotPos):
- self.stream.popupWindow.Close()
- self.stream.popupWindow.Open(localeInfo.EXCHANGE_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
- else:
- if chr.IsNPC(dstChrID):
- net.SendGiveItemPacket(dstChrID, attachedInvenType, attachedItemSlotPos, attachedItemCount)
- else:
- net.SendExchangeStartPacket(dstChrID)
- net.SendExchangeItemAddPacket(attachedInvenType, attachedItemSlotPos, 0)
- else:
- self.__DropItem(attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount)
- def __PutMoney(self, attachedType, attachedMoney, dstChrID):
- if TRUE == chr.HasInstance(dstChrID) and player.GetMainCharacterIndex() != dstChrID:
- net.SendExchangeStartPacket(dstChrID)
- net.SendExchangeElkAddPacket(attachedMoney)
- else:
- self.__DropMoney(attachedType, attachedMoney)
- def __DropMoney(self, attachedType, attachedMoney):
- if uiPrivateShopBuilder.IsBuildingPrivateShop():
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
- return
- if attachedMoney>=1000:
- self.stream.popupWindow.Close()
- self.stream.popupWindow.Open(localeInfo.DROP_MONEY_FAILURE_1000_OVER, 0, localeInfo.UI_OK)
- return
- itemDropQuestionDialog = uiCommon.QuestionDialog()
- itemDropQuestionDialog.SetText(localeInfo.DO_YOU_DROP_MONEY % (attachedMoney))
- itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
- itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
- itemDropQuestionDialog.Open()
- itemDropQuestionDialog.dropType = attachedType
- itemDropQuestionDialog.dropCount = attachedMoney
- itemDropQuestionDialog.dropNumber = player.ITEM_MONEY
- self.itemDropQuestionDialog = itemDropQuestionDialog
- def __DropItem(self, attachedType, attachedItemIndex, attachedItemSlotPos, attachedItemCount):
- if constInfo.GUILDSTORAGE["open"] == 1:
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Du kannst nichts fallen lassen, solange das Gildenlager offen ist.")
- return
- if uiPrivateShopBuilder.IsBuildingPrivateShop():
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
- return
- if player.SLOT_TYPE_INVENTORY == attachedType and player.IsEquipmentSlot(attachedItemSlotPos):
- self.stream.popupWindow.Close()
- self.stream.popupWindow.Open(localeInfo.DROP_ITEM_FAILURE_EQUIP_ITEM, 0, localeInfo.UI_OK)
- else:
- if player.SLOT_TYPE_INVENTORY == attachedType:
- dropItemIndex = player.GetItemIndex(attachedItemSlotPos)
- item.SelectItem(dropItemIndex)
- dropItemName = item.GetItemName()
- questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
- itemDropQuestionDialog = uiCommon.QuestionDialogItem()
- itemDropQuestionDialog.SetText(questionText)
- itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
- itemDropQuestionDialog.SetDestroyEvent(lambda arg=TRUE: self.RequestDestroyItem(arg))
- itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
- itemDropQuestionDialog.Open()
- itemDropQuestionDialog.dropType = attachedType
- itemDropQuestionDialog.dropNumber = attachedItemSlotPos
- itemDropQuestionDialog.dropCount = attachedItemCount
- self.itemDropQuestionDialog = itemDropQuestionDialog
- constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1)
- elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedType:
- dropItemIndex = player.GetItemIndex(player.DRAGON_SOUL_INVENTORY, attachedItemSlotPos)
- elif player.SLOT_TYPE_SKILLBOOK_INVENTORY == attachedType:
- dropItemIndex = player.GetItemIndex(player.SKILLBOOK_INVENTORY, attachedItemSlotPos)
- item.SelectItem(dropItemIndex)
- dropItemName = item.GetItemName()
- questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DROP(dropItemName, attachedItemCount)
- itemDropQuestionDialog = uiCommon.QuestionDialogItem()
- itemDropQuestionDialog.SetText(questionText)
- itemDropQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDropItem(arg))
- itemDropQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDropItem(arg))
- itemDropQuestionDialog.Open()
- itemDropQuestionDialog.dropType = attachedType
- itemDropQuestionDialog.dropNumber = attachedItemSlotPos
- itemDropQuestionDialog.dropCount = attachedItemCount
- self.itemDropQuestionDialog = itemDropQuestionDialog
- constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(1)
- def RequestDestroyItem(self, answer):
- if not self.itemDropQuestionDialog:
- return
- if answer:
- dropType = self.itemDropQuestionDialog.dropType
- dropCount = self.itemDropQuestionDialog.dropCount
- dropNumber = self.itemDropQuestionDialog.dropNumber
- self.itemDropQuestionDialog.Close()
- self.itemDropQuestionDialog = None
- questionText = "Bist du sicher?"
- itemDestroyQuestionDialog = uiCommon.QuestionDialog()
- itemDestroyQuestionDialog.SetText(questionText)
- itemDestroyQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.RequestDestroyItemFinaly(arg))
- itemDestroyQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.RequestDestroyItemFinaly(arg))
- itemDestroyQuestionDialog.dropType = dropType
- itemDestroyQuestionDialog.dropNumber = dropNumber
- itemDestroyQuestionDialog.dropCount = dropCount
- itemDestroyQuestionDialog.Open()
- self.itemDestroyQuestionDialog = itemDestroyQuestionDialog
- def RequestDestroyItemFinaly(self, answer):
- if not self.itemDestroyQuestionDialog:
- return
- if answer:
- dropType = self.itemDestroyQuestionDialog.dropType
- dropNumber = self.itemDestroyQuestionDialog.dropNumber
- if player.SLOT_TYPE_INVENTORY == dropType:
- if dropNumber == player.ITEM_MONEY:
- return
- else:
- self.__SendDestroyItemPacket(dropNumber)
- self.itemDestroyQuestionDialog.Close()
- self.itemDestroyQuestionDialog = None
- constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
- def RequestDropItem(self, answer):
- if not self.itemDropQuestionDialog:
- return
- if answer:
- dropType = self.itemDropQuestionDialog.dropType
- dropCount = self.itemDropQuestionDialog.dropCount
- dropNumber = self.itemDropQuestionDialog.dropNumber
- if player.SLOT_TYPE_INVENTORY == dropType:
- if dropNumber == player.ITEM_MONEY:
- net.SendGoldDropPacketNew(dropCount)
- snd.PlaySound("sound/ui/money.wav")
- else:
- self.__SendDropItemPacket(dropNumber, dropCount)
- elif player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == dropType:
- self.__SendDropItemPacket(dropNumber, dropCount, player.DRAGON_SOUL_INVENTORY)
- elif player.SLOT_TYPE_SKILLBOOK_INVENTORY == dropType:
- self.__SendDropItemPacket(dropNumber, dropCount, player.SKILLBOOK_INVENTORY)
- self.itemDropQuestionDialog.Close()
- self.itemDropQuestionDialog = None
- constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
- def __SendDropItemPacket(self, itemVNum, itemCount, itemInvenType = player.INVENTORY):
- if uiPrivateShopBuilder.IsBuildingPrivateShop():
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
- return
- net.SendItemDropPacketNew(itemInvenType, itemVNum, itemCount)
- def __SendDestroyItemPacket(self, itemVNum, itemInvenType = player.INVENTORY):
- if uiPrivateShopBuilder.IsBuildingPrivateShop():
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.DROP_ITEM_FAILURE_PRIVATE_SHOP)
- return
- net.SendItemDestroyPacket(itemVNum)
- def OnMouseRightButtonDown(self):
- self.CheckFocus()
- if TRUE == mouseModule.mouseController.isAttached():
- mouseModule.mouseController.DeattachObject()
- else:
- player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS)
- return TRUE
- def OnMouseRightButtonUp(self):
- if TRUE == mouseModule.mouseController.isAttached():
- return TRUE
- player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK)
- return TRUE
- def OnMouseMiddleButtonDown(self):
- player.SetMouseMiddleButtonState(player.MBS_PRESS)
- def OnMouseMiddleButtonUp(self):
- player.SetMouseMiddleButtonState(player.MBS_CLICK)
- def OnUpdate(self):
- app.UpdateGame()
- self.day_night()
- if self.mapNameShower.IsShow():
- self.mapNameShower.Update()
- if self.isShowDebugInfo:
- self.UpdateDebugInfo()
- if self.enableXMasBoom:
- self.__XMasBoom_Update()
- self.interface.BUILD_OnUpdate()
- localtime = localtime = time.strftime("[%H:%M:%S]")
- self.timeLine.SetText(localtime)
- self.timeLine.Show()
- def UpdateDebugInfo(self):
- (x, y, z) = player.GetMainCharacterPosition()
- nUpdateTime = app.GetUpdateTime()
- nUpdateFPS = app.GetUpdateFPS()
- nRenderFPS = app.GetRenderFPS()
- nFaceCount = app.GetFaceCount()
- fFaceSpeed = app.GetFaceSpeed()
- nST=background.GetRenderShadowTime()
- (fAveRT, nCurRT) = app.GetRenderTime()
- (iNum, fFogStart, fFogEnd, fFarCilp) = background.GetDistanceSetInfo()
- (iPatch, iSplat, fSplatRatio, sTextureNum) = background.GetRenderedSplatNum()
- if iPatch == 0:
- iPatch = 1
- self.PrintCoord.SetText("Coordinate: %.2f %.2f %.2f ATM: %d" % (x, y, z, app.GetAvailableTextureMemory()/(1024*1024)))
- xMouse, yMouse = wndMgr.GetMousePosition()
- self.PrintMousePos.SetText("MousePosition: %d %d" % (xMouse, yMouse))
- self.FrameRate.SetText("UFPS: %3d UT: %3d FS %.2f" % (nUpdateFPS, nUpdateTime, fFaceSpeed))
- if fAveRT>1.0:
- self.Pitch.SetText("RFPS: %3d RT:%.2f(%3d) FC: %d(%.2f) " % (nRenderFPS, fAveRT, nCurRT, nFaceCount, nFaceCount/fAveRT))
- self.Splat.SetText("PATCH: %d SPLAT: %d BAD(%.2f)" % (iPatch, iSplat, fSplatRatio))
- self.ViewDistance.SetText("Num : %d, FS : %f, FE : %f, FC : %f" % (iNum, fFogStart, fFogEnd, fFarCilp))
- def OnRender(self):
- app.RenderGame()
- if self.console.Console.collision:
- background.RenderCollision()
- chr.RenderCollision()
- (x, y) = app.GetCursorPosition()
- textTail.UpdateAllTextTail()
- if TRUE == wndMgr.IsPickedWindow(self.hWnd):
- self.PickingCharacterIndex = chr.Pick()
- if -1 != self.PickingCharacterIndex:
- textTail.ShowCharacterTextTail(self.PickingCharacterIndex)
- if 0 != self.targetBoard.GetTargetVID():
- textTail.ShowCharacterTextTail(self.targetBoard.GetTargetVID())
- if not self.__IsShowName():
- self.PickingItemIndex = item.Pick()
- if -1 != self.PickingItemIndex:
- textTail.ShowItemTextTail(self.PickingItemIndex)
- if self.__IsShowName():
- textTail.ShowAllTextTail()
- self.PickingItemIndex = textTail.Pick(x, y)
- if systemSetting.IsShowSalesText():
- uiPrivateShopBuilder.UpdateADBoard()
- textTail.UpdateShowingTextTail()
- textTail.ArrangeTextTail()
- if -1 != self.PickingItemIndex:
- textTail.SelectItemName(self.PickingItemIndex)
- grp.PopState()
- grp.SetInterfaceRenderState()
- textTail.Render()
- textTail.HideAllTextTail()
- def OnPressEscapeKey(self):
- if app.TARGET == app.GetCursor():
- app.SetCursor(app.NORMAL)
- elif TRUE == mouseModule.mouseController.isAttached():
- mouseModule.mouseController.DeattachObject()
- else:
- self.interface.OpenSystemDialog()
- return TRUE
- def OnIMEReturn(self):
- if app.IsPressed(app.DIK_LSHIFT):
- self.interface.OpenWhisperDialogWithoutTarget()
- else:
- self.interface.ToggleChat()
- return TRUE
- def OnPressExitKey(self):
- self.interface.ToggleSystemDialog()
- return TRUE
- def BINARY_LoverInfo(self, name, lovePoint):
- if self.interface.wndMessenger:
- self.interface.wndMessenger.OnAddLover(name, lovePoint)
- if self.affectShower:
- self.affectShower.SetLoverInfo(name, lovePoint)
- def BINARY_UpdateLovePoint(self, lovePoint):
- if self.interface.wndMessenger:
- self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
- if self.affectShower:
- self.affectShower.OnUpdateLovePoint(lovePoint)
- def BINARY_OnQuestConfirm(self, msg, timeout, pid):
- confirmDialog = uiCommon.QuestionDialogWithTimeLimit()
- confirmDialog.Open(msg, timeout)
- confirmDialog.SetAcceptEvent(lambda answer=TRUE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
- confirmDialog.SetCancelEvent(lambda answer=FALSE, pid=pid: net.SendQuestConfirmPacket(answer, pid) or self.confirmDialog.Hide())
- self.confirmDialog = confirmDialog
- def Gift_Show(self):
- self.interface.ShowGift()
- def BINARY_Cube_Open(self, npcVNUM):
- self.currentCubeNPC = npcVNUM
- self.interface.OpenCubeWindow()
- if npcVNUM not in self.cubeInformation:
- net.SendChatPacket("/cube r_info")
- else:
- cubeInfoList = self.cubeInformation[npcVNUM]
- i = 0
- for cubeInfo in cubeInfoList:
- self.interface.wndCube.AddCubeResultItem(cubeInfo["vnum"], cubeInfo["count"])
- j = 0
- for materialList in cubeInfo["materialList"]:
- for materialInfo in materialList:
- itemVnum, itemCount = materialInfo
- self.interface.wndCube.AddMaterialInfo(i, j, itemVnum, itemCount)
- j = j + 1
- i = i + 1
- self.interface.wndCube.Refresh()
- def BINARY_Cube_Close(self):
- self.interface.CloseCubeWindow()
- def BINARY_Cube_UpdateInfo(self, gold, itemVnum, count):
- self.interface.UpdateCubeInfo(gold, itemVnum, count)
- def BINARY_Cube_Succeed(self, itemVnum, count):
- self.interface.SucceedCubeWork(itemVnum, count)
- pass
- def BINARY_Cube_Failed(self):
- self.interface.FailedCubeWork()
- pass
- def BINARY_Cube_ResultList(self, npcVNUM, listText):
- if npcVNUM == 0:
- npcVNUM = self.currentCubeNPC
- self.cubeInformation[npcVNUM] = []
- try:
- for eachInfoText in listText.split("/"):
- eachInfo = eachInfoText.split(",")
- itemVnum = int(eachInfo[0])
- itemCount = int(eachInfo[1])
- self.cubeInformation[npcVNUM].append({"vnum": itemVnum, "count": itemCount})
- self.interface.wndCube.AddCubeResultItem(itemVnum, itemCount)
- resultCount = len(self.cubeInformation[npcVNUM])
- requestCount = 7
- modCount = resultCount % requestCount
- splitCount = resultCount / requestCount
- for i in xrange(splitCount):
- net.SendChatPacket("/cube r_info %d %d" % (i * requestCount, requestCount))
- if 0 < modCount:
- net.SendChatPacket("/cube r_info %d %d" % (splitCount * requestCount, modCount))
- except RuntimeError, msg:
- dbg.TraceError(msg)
- return 0
- pass
- def BINARY_Cube_MaterialInfo(self, startIndex, listCount, listText):
- try:
- if 3 > len(listText):
- dbg.TraceError("Wrong Cube Material Infomation")
- return 0
- eachResultList = listText.split("@")
- cubeInfo = self.cubeInformation[self.currentCubeNPC]
- itemIndex = 0
- for eachResultText in eachResultList:
- cubeInfo[startIndex + itemIndex]["materialList"] = [[], [], [], [], []]
- materialList = cubeInfo[startIndex + itemIndex]["materialList"]
- gold = 0
- splitResult = eachResultText.split("/")
- if 1 < len(splitResult):
- gold = int(splitResult[1])
- eachMaterialList = splitResult[0].split("&")
- i = 0
- for eachMaterialText in eachMaterialList:
- complicatedList = eachMaterialText.split("|")
- if 0 < len(complicatedList):
- for complicatedText in complicatedList:
- (itemVnum, itemCount) = complicatedText.split(",")
- itemVnum = int(itemVnum)
- itemCount = int(itemCount)
- self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
- materialList[i].append((itemVnum, itemCount))
- else:
- itemVnum, itemCount = eachMaterialText.split(",")
- itemVnum = int(itemVnum)
- itemCount = int(itemCount)
- self.interface.wndCube.AddMaterialInfo(itemIndex + startIndex, i, itemVnum, itemCount)
- materialList[i].append((itemVnum, itemCount))
- i = i + 1
- itemIndex = itemIndex + 1
- self.interface.wndCube.Refresh()
- except RuntimeError, msg:
- dbg.TraceError(msg)
- return 0
- pass
- def BINARY_Highlight_Item(self, inven_type, inven_pos):
- self.interface.Highligt_Item(inven_type, inven_pos)
- def BINARY_DragonSoulGiveQuilification(self):
- self.interface.DragonSoulGiveQuilification()
- def BINARY_DragonSoulRefineWindow_Open(self):
- self.interface.OpenDragonSoulRefineWindow()
- def BINARY_DragonSoulRefineWindow_RefineFail(self, reason, inven_type, inven_pos):
- self.interface.FailDragonSoulRefine(reason, inven_type, inven_pos)
- def BINARY_DragonSoulRefineWindow_RefineSucceed(self, inven_type, inven_pos):
- self.interface.SucceedDragonSoulRefine(inven_type, inven_pos)
- def BINARY_SetBigMessage(self, message):
- self.interface.bigBoard.SetTip(message)
- def BINARY_SetTipMessage(self, message):
- self.interface.tipBoard.SetTip(message)
- def BINARY_AppendNotifyMessage(self, type):
- if not type in localeInfo.NOTIFY_MESSAGE:
- return
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.NOTIFY_MESSAGE[type])
- def BINARY_Guild_EnterGuildArea(self, areaID):
- self.interface.BULID_EnterGuildArea(areaID)
- def BINARY_Guild_ExitGuildArea(self, areaID):
- self.interface.BULID_ExitGuildArea(areaID)
- def BINARY_GuildWar_OnSendDeclare(self, guildID):
- pass
- def BINARY_GuildWar_OnRecvDeclare(self, guildID, warType):
- mainCharacterName = player.GetMainCharacterName()
- masterName = guild.GetGuildMasterName()
- if mainCharacterName == masterName:
- self.__GuildWar_OpenAskDialog(guildID, warType)
- def BINARY_GuildWar_OnRecvPoint(self, gainGuildID, opponentGuildID, point):
- self.interface.OnRecvGuildWarPoint(gainGuildID, opponentGuildID, point)
- def BINARY_GuildWar_OnStart(self, guildSelf, guildOpp):
- self.interface.OnStartGuildWar(guildSelf, guildOpp)
- def BINARY_GuildWar_OnEnd(self, guildSelf, guildOpp):
- self.interface.OnEndGuildWar(guildSelf, guildOpp)
- def BINARY_BettingGuildWar_SetObserverMode(self, isEnable):
- self.interface.BINARY_SetObserverMode(isEnable)
- def BINARY_BettingGuildWar_UpdateObserverCount(self, observerCount):
- self.interface.wndMiniMap.UpdateObserverCount(observerCount)
- def __GuildWar_UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2, observerCount):
- guildID1 = int(guildID1)
- guildID2 = int(guildID2)
- memberCount1 = int(memberCount1)
- memberCount2 = int(memberCount2)
- observerCount = int(observerCount)
- self.interface.UpdateMemberCount(guildID1, memberCount1, guildID2, memberCount2)
- self.interface.wndMiniMap.UpdateObserverCount(observerCount)
- def __GuildWar_OpenAskDialog(self, guildID, warType):
- guildName = guild.GetGuildName(guildID)
- if "Noname" == guildName:
- return
- import uiGuild
- questionDialog = uiGuild.AcceptGuildWarDialog()
- questionDialog.SAFE_SetAcceptEvent(self.__GuildWar_OnAccept)
- questionDialog.SAFE_SetCancelEvent(self.__GuildWar_OnDecline)
- questionDialog.Open(guildName, warType)
- self.guildWarQuestionDialog = questionDialog
- def __GuildWar_CloseAskDialog(self):
- self.guildWarQuestionDialog.Close()
- self.guildWarQuestionDialog = None
- def __GuildWar_OnAccept(self):
- guildName = self.guildWarQuestionDialog.GetGuildName()
- net.SendChatPacket("/war " + guildName)
- self.__GuildWar_CloseAskDialog()
- return 1
- def __GuildWar_OnDecline(self):
- guildName = self.guildWarQuestionDialog.GetGuildName()
- net.SendChatPacket("/nowar " + guildName)
- self.__GuildWar_CloseAskDialog()
- return 1
- def __ServerCommand_Build(self):
- serverCommandList={
- "ConsoleEnable" : self.__Console_Enable,
- "DayMode" : self.__DayMode_Update,
- "PRESERVE_DayMode" : self.__PRESERVE_DayMode_Update,
- "CloseRestartWindow" : self.__RestartDialog_Close,
- "OpenPrivateShop" : self.__PrivateShop_Open,
- "PartyHealReady" : self.PartyHealReady,
- "ShowMeSafeboxPassword" : self.AskSafeboxPassword,
- "CloseSafebox" : self.CommandCloseSafebox,
- "Teleport" : self.Teleport,
- "CloseMall" : self.CommandCloseMall,
- "ShowMeMallPassword" : self.AskMallPassword,
- "item_mall" : self.__ItemMall_Open,
- "RefineSuceeded" : self.RefineSuceededMessage,
- "RefineFailed" : self.RefineFailedMessage,
- "xmas_snow" : self.__XMasSnow_Enable,
- "xmas_boom" : self.__XMasBoom_Enable,
- "xmas_song" : self.__XMasSong_Enable,
- "xmas_tree" : self.__XMasTree_Enable,
- "newyear_boom" : self.__XMasBoom_Enable,
- "PartyRequest" : self.__PartyRequestQuestion,
- "PartyRequestDenied" : self.__PartyRequestDenied,
- "horse_state" : self.__Horse_UpdateState,
- "hide_horse_state" : self.__Horse_HideState,
- "WarUC" : self.__GuildWar_UpdateMemberCount,
- "mall" : self.__InGameShop_Show,
- "lover_login" : self.__LoginLover,
- "lover_logout" : self.__LogoutLover,
- "lover_near" : self.__LoverNear,
- "lover_far" : self.__LoverFar,
- "lover_divorce" : self.__LoverDivorce,
- "PlayMusic" : self.__PlayMusic,
- "MyShopPriceList" : self.__PrivateShop_PriceList,
- "AnyShop" : self.AnyShopConfiguration,
- "getinputbegin" : self.__Inputget1,
- "getinputend" : self.__Inputget2,
- "GUILDSTORAGE" : self._GuildStorageCMD,
- "GUILDSTORAGE_ADDITEM" : self._GuildStorageAddItem,
- "GUILDSTORAGE_ADDITEMSLOT" : self._GuildStorageAddItemSlot,
- "GUILDSTORAGE_ADDMEMBER" : self._GuildStorageAddMemberToList,
- "GUILDSTORAGE_ADDTEMPSLOT" : self._GuildStorageTempSlotsAdd,
- "GUILDSTORAGE_ADDLOG" : self._GuildStorageAddLog,
- "shop" :self.NewShop,
- "shop_clear" :self.ShopClear,
- "shop_add" :self.ShopAdd,
- "shop_item" :self.ShopItem,
- "shop_cost" :self.ShopCost,
- "shop_cost_clear" :self.ShopCostClear,
- "shop_item_clear" :self.ShopItemClear,
- "gift_clear" :self.gift_clear,
- "gift_item" :self.gift_item,
- "gift_info" :self.gift_show,
- "gift_load" :self.gift_load,
- }
- self.serverCommander=stringCommander.Analyzer()
- for serverCommandItem in serverCommandList.items():
- self.serverCommander.SAFE_RegisterCallBack(
- serverCommandItem[0], serverCommandItem[1]
- )
- def BINARY_ServerCommand_Run(self, line):
- try:
- return self.serverCommander.Run(line)
- except RuntimeError, msg:
- dbg.TraceError(msg)
- return 0
- def __ProcessPreservedServerCommand(self):
- try:
- command = net.GetPreservedServerCommand()
- while command:
- print " __ProcessPreservedServerCommand", command
- self.serverCommander.Run(command)
- command = net.GetPreservedServerCommand()
- except RuntimeError, msg:
- dbg.TraceError(msg)
- return 0
- def PartyHealReady(self):
- self.interface.PartyHealReady()
- def AskSafeboxPassword(self):
- self.interface.AskSafeboxPassword()
- def AskMallPassword(self):
- self.interface.AskMallPassword()
- def __ItemMall_Open(self):
- self.interface.OpenItemMall();
- def CommandCloseMall(self):
- self.interface.CommandCloseMall()
- def RefineSuceededMessage(self):
- snd.PlaySound("sound/ui/make_soket.wav")
- self.PopupMessage(localeInfo.REFINE_SUCCESS)
- def RefineFailedMessage(self):
- snd.PlaySound("sound/ui/jaeryun_fail.wav")
- self.PopupMessage(localeInfo.REFINE_FAILURE)
- def CommandCloseSafebox(self):
- self.interface.CommandCloseSafebox()
- def __PrivateShop_PriceList(self, itemVNum, itemPrice):
- uiPrivateShopBuilder.SetPrivateShopItemPrice(itemVNum, itemPrice)
- def BINARY_Acce_Close(self):
- self.interface.CloseAcceWindow()
- def BINARY_Acce_Open(self, window):
- self.interface.OpenAcceWindow(window)
- def __Horse_HideState(self):
- self.affectShower.SetHorseState(0, 0, 0)
- def __Horse_UpdateState(self, level, health, battery):
- self.affectShower.SetHorseState(int(level), int(health), int(battery))
- def __IsXMasMap(self):
- mapDict = ( "metin2_map_n_flame_01",
- "metin2_map_n_desert_01",
- "metin2_map_spiderdungeon",
- "metin2_map_deviltower1", )
- if background.GetCurrentMapName() in mapDict:
- return FALSE
- return TRUE
- def __XMasSnow_Enable(self, mode):
- self.__XMasSong_Enable(mode)
- if "1"==mode:
- if not self.__IsXMasMap():
- return
- print "XMAS_SNOW ON"
- background.EnableSnow(1)
- else:
- print "XMAS_SNOW OFF"
- background.EnableSnow(0)
- def __XMasBoom_Enable(self, mode):
- if "1"==mode:
- if not self.__IsXMasMap():
- return
- print "XMAS_BOOM ON"
- self.__DayMode_Update("dark")
- self.enableXMasBoom = TRUE
- self.startTimeXMasBoom = app.GetTime()
- else:
- print "XMAS_BOOM OFF"
- self.__DayMode_Update("light")
- self.enableXMasBoom = FALSE
- def __XMasTree_Enable(self, grade):
- print "XMAS_TREE ", grade
- background.SetXMasTree(int(grade))
- def __XMasSong_Enable(self, mode):
- if "1"==mode:
- print "XMAS_SONG ON"
- XMAS_BGM = "xmas.mp3"
- if app.IsExistFile("BGM/" + XMAS_BGM)==1:
- if musicInfo.fieldMusic != "":
- snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
- musicInfo.fieldMusic=XMAS_BGM
- snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
- else:
- print "XMAS_SONG OFF"
- if musicInfo.fieldMusic != "":
- snd.FadeOutMusic("BGM/" + musicInfo.fieldMusic)
- musicInfo.fieldMusic=musicInfo.METIN2THEMA
- snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
- def __RestartDialog_Close(self):
- self.interface.CloseRestartDialog()
- def __Console_Enable(self):
- constInfo.CONSOLE_ENABLE = TRUE
- self.consoleEnable = TRUE
- app.EnableSpecialCameraMode()
- ui.EnablePaste(TRUE)
- def __PrivateShop_Open(self):
- #self.interface.OpenPrivateShopInputNameDialog()
- self.uinewshop.Show()
- def BINARY_PrivateShop_Appear(self, vid, text):
- if chr.GetInstanceType(vid) in [chr.INSTANCE_TYPE_PLAYER, chr.INSTANCE_TYPE_NPC]:
- self.interface.AppearPrivateShop(vid, text)
- def BINARY_PrivateShop_Disappear(self, vid):
- self.interface.DisappearPrivateShop(vid)
- def __PRESERVE_DayMode_Update(self, mode):
- if "light"==mode:
- background.SetEnvironmentData(0)
- elif "dark"==mode:
- if not self.__IsXMasMap():
- return
- background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
- background.SetEnvironmentData(1)
- def __DayMode_Update(self, mode):
- if "light"==mode:
- self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToLight)
- elif "dark"==mode:
- if not self.__IsXMasMap():
- return
- self.curtain.SAFE_FadeOut(self.__DayMode_OnCompleteChangeToDark)
- def __DayMode_OnCompleteChangeToLight(self):
- background.SetEnvironmentData(0)
- self.curtain.FadeIn()
- def __DayMode_OnCompleteChangeToDark(self):
- background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
- background.SetEnvironmentData(1)
- self.curtain.FadeIn()
- def __XMasBoom_Update(self):
- self.BOOM_DATA_LIST = ( (2, 5), (5, 2), (7, 3), (10, 3), (20, 5) )
- if self.indexXMasBoom >= len(self.BOOM_DATA_LIST):
- return
- boomTime = self.BOOM_DATA_LIST[self.indexXMasBoom][0]
- boomCount = self.BOOM_DATA_LIST[self.indexXMasBoom][1]
- if app.GetTime() - self.startTimeXMasBoom > boomTime:
- self.indexXMasBoom += 1
- for i in xrange(boomCount):
- self.__XMasBoom_Boom()
- def __XMasBoom_Boom(self):
- x, y, z = player.GetMainCharacterPosition()
- randX = app.GetRandom(-150, 150)
- randY = app.GetRandom(-150, 150)
- snd.PlaySound3D(x+randX, -y+randY, z, "sound/common/etc/salute.mp3")
- def __PartyRequestQuestion(self, vid):
- vid = int(vid)
- partyRequestQuestionDialog = uiCommon.QuestionDialog()
- partyRequestQuestionDialog.SetText(chr.GetNameByVID(vid) + localeInfo.PARTY_DO_YOU_ACCEPT)
- partyRequestQuestionDialog.SetAcceptText(localeInfo.UI_ACCEPT)
- partyRequestQuestionDialog.SetCancelText(localeInfo.UI_DENY)
- partyRequestQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.__AnswerPartyRequest(arg))
- partyRequestQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.__AnswerPartyRequest(arg))
- partyRequestQuestionDialog.Open()
- partyRequestQuestionDialog.vid = vid
- self.partyRequestQuestionDialog = partyRequestQuestionDialog
- def __AnswerPartyRequest(self, answer):
- if not self.partyRequestQuestionDialog:
- return
- vid = self.partyRequestQuestionDialog.vid
- if answer:
- net.SendChatPacket("/party_request_accept " + str(vid))
- else:
- net.SendChatPacket("/party_request_deny " + str(vid))
- self.partyRequestQuestionDialog.Close()
- self.partyRequestQuestionDialog = None
- def __PartyRequestDenied(self):
- self.PopupMessage(localeInfo.PARTY_REQUEST_DENIED)
- def __InGameShop_Show(self, url):
- if constInfo.IN_GAME_SHOP_ENABLE:
- self.interface.OpenWebWindow(url)
- def __LoginLover(self):
- if self.interface.wndMessenger:
- self.interface.wndMessenger.OnLoginLover()
- def __LogoutLover(self):
- if self.interface.wndMessenger:
- self.interface.wndMessenger.OnLogoutLover()
- if self.affectShower:
- self.affectShower.HideLoverState()
- def __LoverNear(self):
- if self.affectShower:
- self.affectShower.ShowLoverState()
- def __LoverFar(self):
- if self.affectShower:
- self.affectShower.HideLoverState()
- def __LoverDivorce(self):
- if self.interface.wndMessenger:
- self.interface.wndMessenger.ClearLoverInfo()
- if self.affectShower:
- self.affectShower.ClearLoverState()
- def __PlayMusic(self, flag, filename):
- flag = int(flag)
- if flag:
- snd.FadeOutAllMusic()
- musicInfo.SaveLastPlayFieldMusic()
- snd.FadeInMusic("BGM/" + filename)
- else:
- snd.FadeOutAllMusic()
- musicInfo.LoadLastPlayFieldMusic()
- snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)
- def day_night(self):
- import time
- localtime = time.strftime("%H")
- if day.nacht == 0:
- if localtime == "01" or localtime == "02" or localtime == "03" or localtime == "04" or localtime == "05" or localtime == "06" or localtime == "07" or localtime == "00" or localtime == "23" or localtime == "22" or localtime == "21":
- background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
- background.SetEnvironmentData(1)
- day.tag = 0
- day.nacht = 1
- if day.tag == 0:
- if localtime == "11" or localtime == "12" or localtime == "13" or localtime == "14" or localtime == "15" or localtime == "16" or localtime == "17":
- background.SetEnvironmentData(0)
- day.tag = 1
- day.nacht = 0
- if localtime == "08" or localtime == "09" or localtime == "10" or localtime == "18" or localtime == "19" or localtime == "20":
- background.RegisterEnvironmentData(2, constInfo.ENVIRONMENT_EVENING)
- background.SetEnvironmentData(2)
- day.tag = 1
- day.nacht = 0
- def AnyShopConfiguration(self, cmd):
- constInfo.ANYSHOP_CONFIG["GUI"].Configuration(cmd)
- def __Inputget1(self):
- constInfo.INPUT_IGNORE = 1
- def __Inputget2(self):
- constInfo.INPUT_IGNORE = 0
- def __TogglePVPRankingWindow(self):
- self.interface.TogglePVPRankingWindow()
- def __Gildenlager(self):
- constInfo.GUILDSTORAGE["questCMD"] = 'OPEN'
- event.QuestButtonClick(int(constInfo.GUILDSTORAGE["qid"]))
- def BINARY_RecievePVPRankingPacket(self, empire, name, level, kills):
- self.interface.RecievePVPRankingPacket(empire, name, level, kills)
- def _GuildStorageCMD(self, command):
- cmd = command.split("/")
- if cmd[0] == "OPEN":
- self.interface.GuildStorageWindow.Open(int(cmd[1]))
- elif cmd[0] == "REFRESH":
- self.interface.GuildStorageWindow.RefreshSlots()
- elif cmd[0] == "REFRESH_MONEY":
- self.interface.GuildStorageWindow.SetMoney(cmd[1])
- elif cmd[0] == "REFRESH_MEMBERS":
- self.interface.GuildStorageWindow.Adminpanel["board"].RefreshMembers(0)
- elif cmd[0] == "CLEAR_TEMPSLOTS":
- constInfo.GUILDSTORAGE["tempslots"] = {"TAB0" : {},"TAB1" : {},"TAB2" : {}, "TAB3" : {}, "TAB4" : {}, "TAB5" : {}}
- elif cmd[0] == "COMPARE_TEMPSLOTS":
- for i in range(6):
- if constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)] != constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)]:
- constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = {}
- constInfo.GUILDSTORAGE["slots"]["TAB"+str(i)] = constInfo.GUILDSTORAGE["tempslots"]["TAB"+str(i)]
- self.interface.GuildStorageWindow.RefreshSlots()
- elif cmd[0] == "QID":
- self.GuildStorageQID(cmd[1])
- elif cmd[0] == "QUESTCMD":
- self._GuildStorageQuestCMD()
- elif cmd[0] == "MEMBER_COMPLETE":
- constInfo.GUILDSTORAGE["members"] = {}
- self.interface.GuildStorageWindow.ClearMembers()
- constInfo.GUILDSTORAGE["questCMD"] = "GETMEMBERLIST"
- event.QuestButtonClick(int(constInfo.GUILDSTORAGE["qid"]))
- def __Inputget1(self):
- constInfo.INPUT_IGNORE = 1
- def __Inputget2(self):
- constInfo.INPUT_IGNORE = 0
- def _GuildStorageAddItemSlot(self, slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
- self.interface.GuildStorageWindow.AddItemSlot(slot, tab ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6)
- def _GuildStorageAddItem(self, slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
- slotsWidth = 15
- slotsHeight = 8
- slot = int(slot)
- if slot <= 120:
- constInfo.GUILDSTORAGE["slots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 120 and slot <= 240:
- constInfo.GUILDSTORAGE["slots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 240 and slot <= 360:
- constInfo.GUILDSTORAGE["slots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 360 and slot <= 480:
- constInfo.GUILDSTORAGE["slots"]["TAB3"][slot-360] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 480 and slot <= 600:
- constInfo.GUILDSTORAGE["slots"]["TAB4"][slot-480] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 600 and slot <= 720:
- constInfo.GUILDSTORAGE["slots"]["TAB5"][slot-600] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- def _GuildStorageTempSlotsAdd(self,slot ,itemVnum, count, socket0, socket1, socket2, socket3, socket4, socket5, attrtype0,attrvalue0, attrtype1,attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6):
- slot = int(slot)
- if slot <= 120:
- constInfo.GUILDSTORAGE["tempslots"]["TAB0"][slot] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 120 and slot <= 240:
- constInfo.GUILDSTORAGE["tempslots"]["TAB1"][slot-120] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 240 and slot <= 360:
- constInfo.GUILDSTORAGE["tempslots"]["TAB2"][slot-240] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 360 and slot <= 480:
- constInfo.GUILDSTORAGE["tempslots"]["TAB3"][slot-360] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 480 and slot <= 600:
- constInfo.GUILDSTORAGE["tempslots"]["TAB4"][slot-480] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- elif slot > 600 and slot <= 720:
- constInfo.GUILDSTORAGE["tempslots"]["TAB5"][slot-600] = [int(itemVnum),int(count), int(socket0), int(socket1), int(socket2), int(socket3), int(socket4), int(socket5), int(attrtype0),int(attrvalue0), int(attrtype1),int(attrvalue1), int(attrtype2), int(attrvalue2), int(attrtype3), int(attrvalue3), int(attrtype4), int(attrvalue4), int(attrtype5), int(attrvalue5), int(attrtype6), int(attrvalue6)]
- def _GuildStorageAddLog(self,id,name,date,type,do,desc):
- date = date.replace("+-+"," ")
- desc = desc.replace("+-+"," ")
- self.interface.GuildStorageWindow.LogsInsert(id,name,date,type,do,desc)
- constInfo.GUILDSTORAGE["logs"][int(id)] = [name,date,type,do,desc]
- def _GuildStorageQuestCMD(self):
- net.SendQuestInputStringPacket(str(constInfo.GUILDSTORAGE["questCMD"]))
- constInfo.GUILDSTORAGE["questCMD"] = "NULL#"
- def GuildStorageQID(self, qid):
- constInfo.GUILDSTORAGE["qid"] = int(qid)
- def _GuildStorageAddMemberToList(self,memberId,member,authority0,authority1,authority2,authority3):
- constInfo.GUILDSTORAGE["members"]["member"+memberId] = [member,int(authority0),int(authority1),int(authority2),int(authority3)]
- if app.ENABLE_SEND_TARGET_INFO:
- def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
- if not raceNum in constInfo.MONSTER_INFO_DATA:
- constInfo.MONSTER_INFO_DATA.update({raceNum : {}})
- constInfo.MONSTER_INFO_DATA[raceNum].update({"items" : []})
- curList = constInfo.MONSTER_INFO_DATA[raceNum]["items"]
- isUpgradeable = FALSE
- isMetin = FALSE
- item.SelectItem(itemVnum)
- if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
- isUpgradeable = TRUE
- elif item.GetItemType() == item.ITEM_TYPE_METIN:
- isMetin = TRUE
- for curItem in curList:
- if isUpgradeable:
- if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
- if not (itemVnum in curItem["vnum_list"]):
- curItem["vnum_list"].append(itemVnum)
- return
- elif isMetin:
- if curItem.has_key("vnum_list"):
- baseVnum = curItem["vnum_list"][0]
- if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
- if not (itemVnum in curItem["vnum_list"]):
- curItem["vnum_list"].append(itemVnum)
- return
- else:
- if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
- return
- if isUpgradeable or isMetin:
- curList.append({"vnum_list":[itemVnum], "count":itemCount})
- else:
- curList.append({"vnum":itemVnum, "count":itemCount})
- def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
- self.targetBoard.RefreshMonsterInfoBoard()
- def NewShop(self):
- if self.uinewshop:
- self.uinewshop.Show()
- def ShopClear(self):
- if self.uinewshop:
- self.uinewshop.HideAll()
- constInfo.MyShops=[]
- def ShopCostClear(self):
- constInfo.shop_cost=[]
- def ShopCost(self,id,time,time_val,price):
- constInfo.shop_cost.append({"id":int(id),"time":int(time),"time_val":int(time_val),"price":int(price)})
- def ShopAdd(self,shop_id,shop_vid,szSign,gold,count,sold,days,date_close):
- if self.uinewshop:
- shop={
- "id":shop_id,
- "vid":shop_vid,
- "name":szSign.replace("\\"," ").replace("_","#"),
- "gold":gold,
- "sold":sold,
- "items":int(count)-int(sold),
- "days":days,
- "time":date_close
- }
- self.uinewshop.Load(shop)
- constInfo.MyShops.append(shop)
- def ShopItemClear(self):
- if self.uinewshop:
- self.uinewshop.ClearItems()
- def ShopItem(self,data):
- d=data.split("#")
- id=d[0]
- vnum=d[1]
- count=d[2]
- slot=d[3]
- price=d[4]
- s=d[5]
- a=d[6]
- sockets=[]
- for key in s.split("|"):
- sockets.append(int(key))
- attrs=[]
- for key in a.split("|"):
- a=key.split(",")
- attrs.append([int(a[0]),int(a[1])])
- if self.uinewshop:
- self.uinewshop.AddItem(slot,{"id":id,"vnum":vnum,"count":count,"price":price,"sockets":sockets,"attrs":attrs})
- def gift_clear(self):
- constInfo.gift_items={}
- self.interface.ClearGift()
- def gift_item(self, id, vnum, count, pos, date_add, give, reason, szSockets, szAttrs):
- sockets=[]
- for key in szSockets.split("|"):
- sockets.append(int(key))
- attrs=[]
- for key in szAttrs.split("|"):
- a=key.split(",")
- attrs.append([int(a[0]),int(a[1])])
- constInfo.gift_items[int(pos)]={"id":int(id),"vnum":int(vnum),"count":int(count),"pos":int(pos),"date_add":int(date_add),"reason":reason.replace("_"," "),"give":give.replace("_"," "),"sockets":sockets,"attrs":attrs}
- def gift_load(self):
- self.interface.wndGiftBox.Refresh()
- def gift_show(self,pages):
- self.interface.wndGiftBox.pageNum=int(pages)
- self.interface.OpenGift()
- def __Lager(self):
- import event
- event.QuestButtonClick(78)
- def __nopickInfo(self):
- if constInfo.pickInfo == 0:
- constInfo.pickInfo = 1
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Deine Yangdropanzeige wurde aktiviert")
- elif constInfo.pickInfo == 1:
- constInfo.pickInfo = 0
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Deine Yangdropanzeige wurde deaktiviert")
- def __FastEQ(self):
- if self.EQ.IsShow():
- self.EQ.Hide()
- else:
- self.EQ.Show()
- def ToggleSkilbookInventory(self):
- self.interface.ToggleSkillBookInventoryWindow()
- def Switchbot(self):
- if self.switchbot.bot_shown == 1:
- self.switchbot.Hide()
- else:
- self.switchbot.Show()
- def Channelswitcher(self):
- import uiChannel
- a = uiChannel.ChannelChanger()
- a.Show()
- def Teleport(self, getString):
- if getString.find("index") != -1:
- self.teleport.UpdateIndex(int(getString.split("x")[1]))
- else:
- constInfo.SendString = str(self.teleport.SendToServer)
- constInfo.CApiSetHide = 1
- def Karte(self):
- if self.karte.IsShow():
- self.karte.Hide()
- return
- self.karte.initData()
- else:
- self.karte.Open()
Bitte dort um Hilfe währe super lieb
das orginal ist oben verlinkt
-
erledigt danke euch
-
Kopiere es mit STRG+A und STRG+C aus Excel raus füge es in einer neuen TXT ( Leeren ) ein mit STRG+V jedoch bekomm ich immer noch ein fehler in m putty weil das ein anderes format ist
Bei den monster namen sind andere zeichen wie im orginalen keine ahnung wieso das nicht funktioniert
-
Guten Abend
Ich hab eine Frage ich bin auf TXT datein umgestiegen und bearbeite derzeit die Mob_proto.txt mit EXCEL
Ich ändere min_yang , max_yang und EXP Tabelle
Ich füg die TXT auch als TXT in Excel ein jedoch wenn ich die datein Speichere speichert er er die Datei zwar auch als TXT sagt aber dazu das er die Spalten formen möglich ändern könnte
füg ich ich jedoch jetzt die mob_proto.txt ( bearbeitet ) im server ein bekomm ich abort fehler
wie bearbeitet ihr die datein und wie speichert ihr diese wieder ?
-
Schokokeks leider unktioniert dies nicht client läd bei 100% nicht weiter
Hier nochmal wie ich es eingefügt habe :
Bitte melden Sie sich an, um diesen Link zu sehen.
Alles eingefügt bis auf den letzten punkt mit :
mit diesen code weiß ich nicht wo hin bzw vllt ist er überflüssig
Hier noch die Funktion von mir das die Karte sich öffnen lassen soll an der Sidebar :
Bitte melden Sie sich an, um diesen Link zu sehen.
Bitte melden Sie sich an, um diesen Link zu sehen.
Ingame komm ich ohne Probleme jedoch lässt sie sich nicht öffnen woran liegt der fehler ?
-
Guten Tag
Ich hab grad dieses Teleport System eingebaut :
Bitte melden Sie sich an, um diesen Link zu sehen.
Ich Möchte es aber jetzt in die Sidebar machen damit ich es dort drüber aufrufen kann :
Bitte melden Sie sich an, um diesen Link zu sehen.
Jedoch weiß ich nicht genau wie ich den Karten Butten die funktion geben kann das, dass system geöffnet wird hatte es schon probiert jedoch mit misserfolg :
Bitte melden Sie sich an, um diesen Link zu sehen.
Könnte mir jemand bitte erklären wie das funktioniert bzw ob sich was mit der orginal funktion überschnitten hat ?
Hier meine root.eix /epk
Bitte melden Sie sich an, um diesen Link zu sehen.
wäre mega lieb wenn ihr mal schaut ob es richtig eingebaut ist / oder mir es einbauen könnten + sidebar funktion und ich mir dies anschauen kann wäre mega lieb danke