Jump to content

hpgalvao

Inactive Member
  • Posts

    8
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by hpgalvao

  1. dae guys!

    I'll show you a cool MySQL script that can search for clone items in your server's database. This script will help you find and remove any clone items.

    * just arms with magic damager and natural damanger!

    WITH itens AS (
    SELECT *,
    md5(CONCAT_WS(',',attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4)) chaveunica
    FROM player.item
    WHERE attrvalue2>0 AND attrvalue3>0 
    AND `window` not IN ('SAFEBOX','MALL') 
    AND attrtype0 IN (71,72)
    ),
    
    duplicados AS (
    SELECT 
    chaveunica,COUNT(*) clones, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4 
    FROM itens 
    GROUP BY attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4
    HAVING COUNT(*)>1
    )
    ,donos AS (
    SELECT 
    a.login,p.last_play,p.name nome,
    ii.empire,g.name guilda,gm.is_general,pp.locale_name,i.chaveunica hash_,d.clones iguais,
    i.* FROM itens i 
    LEFT JOIN player.item_proto pp ON pp.vnum=i.vnum
    LEFT JOIN player.player p ON p.id=i.owner_id
    LEFT JOIN duplicados d ON d.chaveunica = i.chaveunica
    LEFT JOIN player.guild_member gm ON gm.pid = p.id
    LEFT JOIN player.guild g ON g.id = gm.guild_id
    LEFT JOIN `account`.account a ON a.id = p.account_id
    LEFT JOIN player.player_index ii ON ii.id = a.id
    WHERE i.chaveunica IN (SELECT chaveunica FROM duplicados)
    )
    SELECT * FROM donos;

    AND attrtype0 IN (71,72) is the line that specifies the type of item you're searching for.

    good lock!

     

    • Metin2 Dev 1
  2. Hi guys!

    use a mysql editor (HeidSQL or NavCat) and select your ACCOUNT.ACCOUNT table to crate a trigger script.

    Run this query: 

    CREATE TRIGGER `account_before_update` BEFORE UPDATE ON `account` FOR EACH ROW BEGIN
    /* TRIGGER WRITED BY [ADM]Arkatuz (Meleb.Net) */
    if (LEFT(NEW.password,1)<>'*') then
    SET NEW.password = PASSWORD(NEW.password);
    END if;
    END

    Now, your can update PASSWORD column directly of the Mysql Editor. Eg.: your put 'mypasswd123' and the trigger crated go crypt to '*DD33176027C486CECB9B6F770756A1C115A1F659'. This is good to help administer your server without external applications to generate passwords. 

    good lock! ^^

     

    • Metin2 Dev 1
    • Good 2
    • Love 1
  3. sorry my english.

    let´s program!

    access your file server with PUTTY;

    and access the maps folder. something like '/root/metin2/srv1/share/locale/germany/map'.

    cd /root/metin2/srv1/share/locale/germany/map

    now... create a file named 'datamaps.sh'.

    edit datamaps.sh

    the file must contain the content below:

    #!/bin/sh
    gecho () { echo -e "\033[32m$1\033[0m"; }
    cecho () { echo -e "\033[36m$1\033[0m"; }
    
    echo "CH	INDEX	MAP_FOLDER	WARP	X	Y" >LISTARGEM_WARP.TXT
    
    clear 
    echo "Script writed by Helio Galvão [Meleb.Net] - Gerar dados dos Mapas"
    cecho "Aguarde. Gerando lista de informações dos Mapas..."
    
    for map in $(find . -maxdepth 1 -mindepth 1 -type d | awk '{print substr ($1, 3, 100)}' | awk '{print $1} ')
    do
    replace=warp
    index=$(cat index | grep -w $map | awk '{print $1}')
    mapa=$(cat index | grep -w $map | awk '{print $2}')
    warp=$(cat $map/Setting.txt | grep BasePosition | sed "s/BasePosition/${replace}/Ig")
    if [ -z "$index" ]; then
    	index=0
    fi
    
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH1_1 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "[CH1_1]")
    fi
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH1_2 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "$chans[CH1_2]")
    fi
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH1_3 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "$chans[CH1_3]")
    fi
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH2_1 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "$chans[CH2_1]")
    fi
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH2_2 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "$chans[CH2_2]")
    fi
    achou=$(cat /root/metin2/srv1/share/conf/CONFIG_CH99 | grep -i MAP_ALLOW | grep -w $index )
    if [ -n "$achou" ]; then	
    	chans=$(echo "$chans[CH_99]")
    fi
    if [ -z "$chans" ]; then	
    	chans=[NONE]
    fi
    if [ -z "$warp" ]; then	
    	warp="warp	0	0"
    fi
    
    echo "$chans	$index	$map	$warp" >>LISTARGEM_WARP.TXT
    chans=
    achou=
    warp=
    done
    
    cat LISTARGEM_WARP.TXT
    
    echo "-------------------------------------"
    gecho "LISTARGEM_WARP.TXT foi Gerado."
    cecho "Abra o arquivo para consultar as coordenadas dos mapas"
    cecho "bem como seus index e em quais canais estão instalados."
    echo "**Você pode importar para uma planilha se preferir."
    echo ""

     

    Note: change paths similar to '/root/metin2/srv1/share/conf/CONFIG_CH1_1' to paths with your CONFIGURATION FILES.

     

    set the permission for it

    chmod 774 datamaps.sh

     

    execute.

    ./datamaps.sh

     

    a new one will be generated containing information from the maps, such as:
    * coordinates: values to use in /warp commands;
    * index: identification of the map within the system;
    * active channels: on which CH the map is enabled.

     

    Below is an example of the generated file. Very useful to consult and assist in testing.

    CHANNEL	INDEX	MAP_FOLDER	WARP	X	Y
    [NONE]	0	metin2_map_siege_01	warp	102400	332800
    [CH1_2]	217	metin2_map_spiderdungeon_03	warp	51200	563200
    [NONE]	0	metin2_map_sungzi_snow_pass01	warp	1177600	102400
    [NONE]	0	metin2_map_battlearena03	warp	768000	230400
    [CH_99]	105	metin2_map_t2	warp	6400	0
    [CH1_1][CH2_1][CH2_2]	21	metin2_map_b1	warp	0	102400
    [NONE]	0	metin2_map_sungzi_snow_pass02	warp	1177600	204800
    [CH1_3][CH2_2]	66	metin2_map_deviltower1	warp	204800	665600
    [CH2_2]	101	metin2_map_resources_zon	warp	3200000	51200
    [NONE]	0	metin2_map_n_desert_02	warp	307200	1049600
    [CH2_2][CH_99]	103	metin2_map_t1	warp	0	25600
    [NONE]	0	metin2_map_n_flame_01	warp	588800	614400
    [CH1_2]	7	metin2_map_b2	warp	955100	955100
    [CH1_3]	351	metin2_map_n_flame_dungeon_01	warp	742400	614400
    [NONE]	0	metin2_map_holyplace_ice	warp	1484800	0

     

    Note: [NONE] These are maps that have not been installed but the folder exists.

     

    thank you guys!
    any doubts, ask!

     

     

    • Good 4
×
×
  • 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.