Jump to content

rawn3cr0

Member
  • Posts

    103
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by rawn3cr0

  1. ACMD(do_shop_delete)
    {
    	char arg1[256];
    	one_argument(argument, arg1, sizeof(arg1));
    	if (!*arg1)
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, "Usage:");
    		ch->ChatPacket(CHAT_TYPE_INFO, "/delete_shop <type> <arg> ");
    		ch->ChatPacket(CHAT_TYPE_INFO, "Types:");
    		ch->ChatPacket(CHAT_TYPE_INFO, "		id - Delete item from shop using ID");
    		ch->ChatPacket(CHAT_TYPE_INFO, "Example:");
    		ch->ChatPacket(CHAT_TYPE_INFO, "		/delete_shop id 1");
    		return;
    	}
    	if (!strcmp(arg1, "id"))
    	{
    		SQLMsg * pkMsg(DBManager::instance().DirectQuery("delete from player_shop_items WHERE id='%s'", arg1));
    		SQLResult * pRes = pkMsg->Get();
    		if (pRes->uiNumRows>0)
    		{
    			MYSQL_ROW row;
    			while ((row = mysql_fetch_row(pRes->pSQLResult)) != NULL)
    			{
    				DWORD id;
    				str_to_number(id, arg1);
    				DBManager::instance().DirectQuery("delete from player_shop_items WHERE id='%s'", id);
    			}
    		}
    		else
    			ch->ChatPacket(CHAT_TYPE_INFO, "Shop %s does exists", arg1);
    	}
    }

     

  2. Acum 40 minute, asdajdja a spus:

    Well the coordinates you have in db are global whereas the one in game are local (map). 

    Try checking the coordinates against atlasinfo.txt it should be (global map coordinates + local coordinates = values in db) if this is true then all you have to do is write up map indexes with their global coordinates do some math against the coordinates from db and you have your plain local coords.

    I think best solution is to edit  target_pos  function to work with global coordinates. But i don't know how..

  3. How i can convert database coord in minimap coord. Character is in same place about 1 hour. I need for a traget system... and i need coords from db but don't work , just with minimap.

    Qhz7Anu.jpg

    Or to modifi this to work with database coord:

    	int target_pos(lua_State* L)
    	{
    		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    		int iQuestIndex = CQuestManager::instance().GetCurrentPC()->GetCurrentQuestIndex();
    
    		if (!lua_isstring(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
    		{
    			sys_err("invalid argument, name: %s, quest_index %d", ch->GetName(), iQuestIndex);
    			return 0;
    		}
    
    		PIXEL_POSITION pos;
    
    		if (!SECTREE_MANAGER::instance().GetMapBasePositionByMapIndex(ch->GetMapIndex(), pos))
    		{
    			sys_err("cannot find base position in this map %d", ch->GetMapIndex());
    			return 0;
    		}
    
    		int x = pos.x + (int) lua_tonumber(L, 2) * 100;
    		int y = pos.y + (int) lua_tonumber(L, 3) * 100;
    
    		CTargetManager::instance().CreateTarget(ch->GetPlayerID(),
    				iQuestIndex,
    				lua_tostring(L, 1),
    				TARGET_TYPE_POS,
    				x,
    				y,
    				(int) lua_tonumber(L, 4),
    				lua_isstring(L, 5) ? lua_tostring(L, 5) : NULL,
    				lua_isnumber(L, 6) ? (int)lua_tonumber(L, 6): 1);
    
    		return 0;
    	}

    If i put minimap coord work ex :target.pos("__TARGET__", 382, 687, 41, "Test Titlu")  but with database coord not work ex :target.pos("__TARGET__", 959890, 273537, 41, "Test Titlu")

    How i can modifi this to work with database coord?

  4. Acum 15 ore, VegaS™ a spus:

    I don't understand why u guys, use search string name same as the return one for non-sense...

    
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INFO_DESTROY_ITEM"), item->GetName());
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("INFO_DESTROY_ITEM_WARNING"), item->GetName());
    • ../share/locale/germany/locale_string.txt
    
    "INFO_DESTROY_ITEM";
    "[Info] Ai distrus %s.";
    
    "INFO_DESTROY_ITEM_WARNING";
    "|cff8ddcab[Info]|r |cffffffffItem-ul|r |cFFFFC700%s|r |cffffffffnu se mai poate recupera.|r";

     

    Ty VegaS . Resolved.

  5. Hi

    How i can make to read with color from locale_string.txt ?

    ChatPacket(CHAT_TYPE_INFO, "[Info] Ai distrus %s.", item->GetName());
    ChatPacket(CHAT_TYPE_INFO, "|cff8ddcab[Info]|r |cffffffffItem-ul|r |cFFFFC700%s|r |cffffffffnu se mai poate recupera.|r", item->GetName());

    LNtZabg.png

     

     

  6. After i implement sahs sistem by lent

    Sash is move to Mount slot.

    Mount not work and have absortion.


    gametype.h client

    #ifdef ENABLE_COSTUME_SYSTEM
       const DWORD c_Costume_Slot_Start   = c_Equipment_Start + 19;   // [ÁÖÀÇ] ¼ýÀÚ(19) ÇϵåÄÚµù ÁÖÀÇ. ÇöÀç ¼­¹ö¿¡¼­ ÄÚ½ºÃõ ½½·ÔÀº 19ºÎÅÍÀÓ. ¼­¹ö common/length.h ÆÄÀÏÀÇ EWearPositions ¿­°ÅÇü Âü°í.
        const DWORD   c_Costume_Slot_Body      = c_Costume_Slot_Start + 0;
       const DWORD   c_Costume_Slot_Hair      = c_Costume_Slot_Start + 1;
        const DWORD   c_Costume_Slot_Mount = c_Costume_Slot_Start + 2;
       const DWORD   c_Costume_Slot_Sash    = c_Costume_Slot_Start + 3;
        const DWORD c_Costume_Slot_Count    = 4;
       const DWORD c_Costume_Slot_End      = c_Costume_Slot_Start + c_Costume_Slot_Count;
     #endif

     

    Spoiler

  7. How i can modify this code from this:

    DDkYjoI.jpg

    To this:

    6TVd9Wn.jpg

    void CInputMain::PrivateSearch(LPCHARACTER ch, const char * data)
    {
    
    	struct packet_private_search * pinfo = (struct packet_private_search *) data;
    	const char* Item_Search = pinfo->item_name; //Nombre Recibido
    	int Item_Gold = pinfo->item_gold;
    
    	if (strlen(Item_Search) == 0){
    		ch->ChatPacket(CHAT_TYPE_INFO,"[Shop Search] No ha colocado ninguno nombre.");
    		return;
    	}
    	if (Item_Gold < 0){
    		ch->ChatPacket(CHAT_TYPE_INFO,"[Shop Search] Coloque un valor mayor a 0");
    		return;
    	}
    	if (Item_Gold > 2000000000){
    		ch->ChatPacket(CHAT_TYPE_INFO,"[Shop Search] Coloque un valor menos de 2kkk");
    		return;
    	}
    
    
    	int check = 0;
    	int check_0 = 0;
        char szQuery[1024];
    	snprintf(szQuery, sizeof(szQuery),"SELECT * FROM player.offline_shop_item WHERE status=0 and mapIndex=%d",ch->GetMapIndex());
    	std::auto_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery));
    	std::auto_ptr<SQLMsg> pMsg1(DBManager::Instance().DirectQuery(szQuery));
    
    	if (pMsg->Get()->uiNumRows > 0) 
    	{
    		//Check si no existe ningun item con ese nombre
    		while (MYSQL_ROW row_check = mysql_fetch_row(pMsg1->Get()->pSQLResult))
    		{
    			const char * Item_Totales_0 = row_check[43]; //Nombres Tablas
    			const char * Item_Vnums_0 = row_check[4]; //Vnums Tablas
    			const char * Item_Gold_0 = row_check[41]; //Gold Tablas
    
    		 	DWORD Vnum_Item_0 = 0;
    			str_to_number(Vnum_Item_0, Item_Vnums_0); //Convierte el vnum de string a numero entero
    
    			int Gold_Item_0 = 0;
    			str_to_number(Gold_Item_0, Item_Gold_0); //Convierte el vnum de string a numero entero
    
    			if (strstr(Item_Totales_0, Item_Search)){
    				check++;
    			}
    			if (Item_Gold > 0){
    				if (Gold_Item_0 <= Item_Gold){
    					check_0++;
    				}
    			}
    		}
    		if(check == 0){
    			ch->ChatPacket(CHAT_TYPE_INFO,"[Shop Search] No se encuentra ningun item con ese nombre.");
    			return;
    		}
    		if (Item_Gold > 0){
    			if(check_0 == 0){
    				ch->ChatPacket(CHAT_TYPE_INFO,"[Shop Search] No existe ningun item con ese valor.");
    				return;
    			}
    		}
    
    		while (MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult))
    		{
    			const char * Item_Totales = row[43]; //Nombres Tablas
    			const char * Item_Vnums = row[4]; //Vnums Tablas
    			const char * Item_Gold_1 = row[41]; //Gold Tablas
    
    		 	DWORD Vnum_Item = 0;
    			str_to_number(Vnum_Item, Item_Vnums); //Convierte el vnum de string a numero entero
    
    			int Gold_Item = 0;
    			str_to_number(Gold_Item, Item_Gold_1); //Convierte el vnum de string a numero entero
    
    			if (strstr(Item_Totales, Item_Search)){
    				if (Item_Gold > 0){
    					if (Gold_Item <= Item_Gold){
    						ch->ChatPacket(CHAT_TYPE_COMMAND, "PrivateSearch_ItemsSearch %d",Vnum_Item);
    						ch->ChatPacket(CHAT_TYPE_COMMAND, "PrivateSearch_RefreshItems");
    					}
    				}else{
    					ch->ChatPacket(CHAT_TYPE_COMMAND, "PrivateSearch_ItemsSearch %d",Vnum_Item);
    					ch->ChatPacket(CHAT_TYPE_COMMAND, "PrivateSearch_RefreshItems");
    				}
    			}
    		}
    	}
    }

    Best regards.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.