Jump to content

kingshero

Inactive Member
  • Posts

    101
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by kingshero

  1. i know all the ports and service 

    if you need help me i send all to you 

    8 hours ago, Vanilla said:

    No one can give you a PF script that's magically working for you. You'll have to open the ports needed and apply rules for them. I don't know what software you're running, which ports you are using, etc... So yeah, I'd give you a sample script which will of course work.. But then again the expected results won't appear.

     

  2. 2 hours ago, Vanilla said:

    I recommend using PF which is a builtin packet filter for FreeBSD. Configure it, limit connections and write exceeding connections into a blacklist.

     And tune your sysctl variables a bit if you haven't done so in the past. There are some options you can add safely but for a real hardening you'd know what you're doing.

    do you have PF script

  3. 2 minutes ago, Vanilla said:

    The only efficient way of blocking a DDoS attack is by using a hardware firewall. Without it, you can't win this fight.

     What you can do is blocking DoS attacks with a software firewall. But unlike a DoS-attack, the DDoS attack is effective as soon as it hits your machine. The only thing you can do is try and harden your system and configure a software firewall. But it probably won't do much.

    how to make this 

  4. hello every one

    i have more ddos attack from some baby

    the server is work is ok but when attack begin Login to game stop and no one can login But the players who have already login in are working with them naturally As long as the attack occurs, errors occur in the system like this

    SYSERR: Aug 17 06:55:33 :: Analyze: Handshake phase does not handle packet 69 (fd 38)
    SYSERR: Aug 17 06:55:33 :: Process: SEQUENCE 2dd3e000 mismatch 0xe7 != 0x1 header 69
    SYSERR: Aug 17 06:55:33 :: Process: SEQUENCE_LOG [UNKNOWN]-------------
        [069 : 0xe7]

     and i have in log in core1 and auth1 more ips like this

    Aug 13 00:16:11 :: SYSTEM: new connection from [190.12.58.187] fd: 20 handshake 2604812299 output input_len 0, ptr 0x36076400 Aug 13 00:16:11 :: SYSTEM: closing socket. DESC #21

    please help me

     

  5. hello

    in client src in 

    PythonNetworkStreamPhaseGame.cpp

    in this function

    bool CPythonNetworkStream::RecvGuild()

     i see 

        switch (GuildPacket.subheader)
        {

    case GUILD_SUBHEADER_GC_LIST:
            {

    how to get TPacketGCGuildSubMember

    i edited to in packet.h in client src

    typedef struct packet_guild_sub_member
    {
        DWORD pid;
        BYTE byGrade;
        BYTE byIsGeneral;
        BYTE byJob;
        BYTE byLevel;
        DWORD dwOffer;
        BYTE byNameFlag;
        DWORD king;
    } TPacketGCGuildSubMember;

    from game this packet in game src  packet.h not found and 

    when edit TGuildMemberPacketData in guild.h 

    in guild.h

    TGuildMemberPacketData

    typedef struct SGuildMemberPacketData
    {
        DWORD pid;
        BYTE grade;
        BYTE is_general;
        BYTE job;
        BYTE level;
        DWORD offer;
        BYTE name_flag;
        char name[CHARACTER_NAME_MAX_LEN + 1];

       DWORD king;

    } TGuildMemberPacketData;

    but same problem

    i have SYSERR: Unknown packet header: 102, last: 75 75 in client syserr 

    this code in guild.cpp

    void CGuild::SendListOneToAll(DWORD pid)
    {
    
    	TPacketGCGuild pack;
    	pack.header = HEADER_GC_GUILD;
    	pack.size = sizeof(TPacketGCGuild);
    	pack.subheader = GUILD_SUBHEADER_GC_LIST;
    
    	pack.size += sizeof(TGuildMemberPacketData);
    
    	char c[CHARACTER_NAME_MAX_LEN + 1];
    	memset(c, 0, sizeof(c));
    
    	auto cit = m_member.find(pid);
    	if(cit == m_member.end())
    	{
    		return;
    	}
    
    	for(auto it = m_memberOnline.begin(); it != m_memberOnline.end(); ++it)
    	{
    		LPDESC d =(*it)->GetDesc();
    		if(!d)
    		{
    			continue;
    		}
    
    		TEMP_BUFFER buf;
    
    		buf.write(&pack, sizeof(pack));
    
    		cit->second._dummy = 1;
    
    		buf.write(&(cit->second), sizeof(DWORD) * 3 + 1);
    		buf.write(cit->second.name.c_str(), cit->second.name.length());
    		buf.write(c, CHARACTER_NAME_MAX_LEN + 1 - cit->second.name.length());
    		d->Packet(buf.read_peek(), buf.size());
    	}
    }

    i get GUILD_SUBHEADER_GC_LIST

    in this but i can't understand how to change this ? to send another 

     

    i edited this table.h

    typedef struct SPacketDGGuildMember
    {
        DWORD dwPID;
        DWORD dwGuild;
        BYTE bGrade;
        BYTE isGeneral;
        BYTE bJob;
        BYTE bLevel;
        DWORD dwOffer;
        char szName[CHARACTER_NAME_MAX_LEN + 1];
        DWORD king;
    } TPacketDGGuildMember;

    but same problem

  6. hello

    in client src in 

    PythonNetworkStreamPhaseGame.cpp

    in this function

    bool CPythonNetworkStream::RecvGuild()

     i see 

        switch (GuildPacket.subheader)
        {

    case GUILD_SUBHEADER_GC_LIST:
            {

    how to get TPacketGCGuildSubMember

    from game this packet in game src  packet.h not found and 

    when edit TGuildMemberPacketData in guild.h 

    i have SYSERR: Unknown packet header: 102, last: 75 75 in client syserr 

  7. hello all 

    explain problem :

    when start war

    like use this command : /war guild_name 1 or /war guild_name 2

    i have crash core in core 1 , core 2 and core 3

    this crash Happen after notice in chat 

    ------------

    before warp to map 110 or 111

    in this moment the core 1 , core 2 and core 3 is crash and see this 4 line on putty 

    Spoiler

    Assertion failed: (ms_singleton), function instance, file ./../../common/singleton.h, line 24.
    Assertion failed: (ms_singleton), function instance, file ./../../common/singleton.h, line 24.
    Assertion failed: (ms_singleton), function instance, file ./../../common/singleton.h, line 24.
    Assertion failed: (ms_singleton), function instance, file ./../../common/singleton.h, line 24.

    and when debug core 

    i have this

    Spoiler

    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "i386-marcel-freebsd"...
    Core was generated by `./ch1-core1'.
    Program terminated with signal 6, Aborted.
    #0  0x084f6b5b in thr_kill ()
    [New Thread 28c05a80 (LWP 101011/<unknown>)]
    [New Thread 28c05800 (LWP 101007/<unknown>)]
    [New Thread 28c05580 (LWP 101006/<unknown>)]
    [New Thread 28c05080 (LWP 100115/<unknown>)]
    (gdb) where
    #0  0x084f6b5b in thr_kill ()
    #1  0x084f6b4d in raise ()
    #2  0x084f6aa8 in abort ()
    #3  0x08520fe3 in __assert ()
    #4  0x0810f1fb in CInputDB::GuildWar (this=<value optimized out>, c_pData=<value optimized out>) at singleton.h:24
    #5  0x08110c03 in CInputDB::Analyze (this=<value optimized out>, d=<value optimized out>, bHeader=<value optimized out>, c_pData=<value optimized out>) at input_db.cpp:2057
    #6  0x08111ff9 in CInputDB::Process (this=0x28c9bc34, d=0xbfbfc0a0, orig=<value optimized out>, bytes=<value optimized out>) at input_db.cpp:2094
    #7  0x080d24c1 in DESC::ProcessInput (this=0x28c9b980) at desc.cpp:270
    #8  0x0813a1c3 in io_loop (fdw=0x28dba180) at main.cpp:670
    #9  0x08139cf7 in idle () at main.cpp:594
    #10 0x08138837 in main (argc=<value optimized out>, argv=<value optimized out>) at main.cpp:325
    (gdb) bt full
    #0  0x084f6b5b in thr_kill ()
    No symbol table info available.
    #1  0x084f6b4d in raise ()
    No symbol table info available.
    #2  0x084f6aa8 in abort ()
    No symbol table info available.
    #3  0x08520fe3 in __assert ()
    No symbol table info available.
    #4  0x0810f1fb in CInputDB::GuildWar (this=<value optimized out>, c_pData=<value optimized out>) at singleton.h:24
    No locals.
    #5  0x08110c03 in CInputDB::Analyze (this=<value optimized out>, d=<value optimized out>, bHeader=<value optimized out>, c_pData=<value optimized out>) at input_db.cpp:2057
    No locals.
    #6  0x08111ff9 in CInputDB::Process (this=0x28c9bc34, d=0xbfbfc0a0, orig=<value optimized out>, bytes=<value optimized out>) at input_db.cpp:2094
            pRealData = <value optimized out>
            r_iBytesProceed = (int &) Cannot access memory at address 0x0
    (gdb)
     

    please help in my problem and thanks for all

    syslog in core 1 after crash

    Spoiler

    May 27 09:19:26 :: GuildWar.DeclareWar id(1 -> 3), type(1)
    May 27 09:19:26 :: InputDB::GuildWar 1 3 state 1
    May 27 09:19:29 :: COMMAND: hhh: war
    May 27 09:19:29 :: GuildWar.WaitStartSendToDB id(3 vs 1), type(1), bet(0), map_index(110)
    May 27 09:19:29 :: ReserveWarAdd 9 gid1 1 power 0 gid2 3 power 0 handicap 0
    May 27 09:19:29 :: InputDB::GuildWar 3 1 state 9
    May 27 09:19:29 :: GuildManager::ReserveWar 3 1
    May 27 09:19:29 :: Guild::ReserveWar 1
    May 27 09:19:29 :: Guild::ReserveWar 3
    May 27 09:19:39 :: ReserveWarDelete 9
    May 27 09:19:39 :: InputDB::GuildWar 1 3 state 4
    May 27 09:19:39 :: GuildWar.WaitStartWar.CheckWarServer id(1 -> 3), type(1), map(110)
    May 27 09:19:39 :: PRIVATE_MAP: 1100000 created(original 110)
    May 27 09:19:39 :: GuildWar.WaitStartWar.CreateMap id(1 vs 3), type(1), map(110) -> map_inst(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(1 -> 3), map(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(3 -> 1), map(1100000)
    May 27 09:19:39 :: P2P: GuildWarZoneMapIndex g1(1) vs g2(3), mapIndex(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(1 -> 3), map(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(3 -> 1), map(1100000)
    ------------------------

    crash core 1 -----

    syslog in core 2 after crash

    Spoiler

    May 27 09:19:03 :: P2P: Login [king]
    May 27 09:19:05 :: P2P: Login hhh
    May 27 09:19:26 :: InputDB::GuildWar 1 3 state 1
    May 27 09:19:29 :: ReserveWarAdd 9 gid1 1 power 0 gid2 3 power 0 handicap 0
    May 27 09:19:29 :: InputDB::GuildWar 3 1 state 9
    May 27 09:19:29 :: GuildManager::ReserveWar 3 1
    May 27 09:19:29 :: Guild::ReserveWar 1
    May 27 09:19:29 :: Guild::ReserveWar 3
    May 27 09:19:39 :: ReserveWarDelete 9
    May 27 09:19:39 :: InputDB::GuildWar 1 3 state 4
    May 27 09:19:39 :: GuildWar.WaitStartWar.CheckWarServer id(1 -> 3), type(1), map(110)
    May 27 09:19:39 :: PRIVATE_MAP: 1100000 created(original 110)
    May 27 09:19:39 :: GuildWar.WaitStartWar.CreateMap id(1 vs 3), type(1), map(110) -> map_inst(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(1 -> 3), map(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(3 -> 1), map(1100000)
    May 27 09:19:39 :: P2P: GuildWarZoneMapIndex g1(1) vs g2(3), mapIndex(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(1 -> 3), map(1100000)
    May 27 09:19:39 :: GuildWar.SetGuildWarMapIndex id(3 -> 1), map(1100000)
     


    syslog in db after crash

    Spoiler

    May 27 09:19:26 :: GuildWar: GUILD_WAR_SEND_DECLARE type(Theater) guild(1 - 3)
    May 27 09:19:26 :: GuildWar: AddDeclare(Type:1,from:1,to:3)
    May 27 09:19:26 :: [      450] return 0/0/0 async 0/0/0
    May 27 09:19:29 :: GuildWar: GUILD_WAR_WAIT_START type(Theater) guild(3 - 1)
    May 27 09:19:29 :: GuildWar: RemoveDeclare(from:3,to:1)
    May 27 09:19:29 :: GuildWar: 1 lvp 55000 rkp 55000 alv 63 mc 3 power 0
    May 27 09:19:29 :: GuildWar: 3 lvp 28000 rkp 50000 alv 34 mc 3 power 0
    May 27 09:19:29 :: GuildWar: handicap 0
    May 27 09:19:30 :: GuildWar: started GID1 1 GID2 3 0 time -9 min 1
    May 27 09:19:31 :: [      500] return 0/0/0 async 0/0/0
    May 27 09:19:31 :: GuildWar: started GID1 1 GID2 3 0 time -8 min 1
    May 27 09:19:32 :: GuildWar: started GID1 1 GID2 3 0 time -7 min 1
    May 27 09:19:33 :: GuildWar: started GID1 1 GID2 3 0 time -6 min 1
    May 27 09:19:34 :: GuildWar: started GID1 1 GID2 3 0 time -5 min 1
    May 27 09:19:35 :: GuildWar: started GID1 1 GID2 3 0 time -4 min 1
    May 27 09:19:36 :: [      550] return 0/0/0 async 0/0/0
    May 27 09:19:36 :: GuildWar: started GID1 1 GID2 3 0 time -3 min 1
    May 27 09:19:37 :: GuildWar: started GID1 1 GID2 3 0 time -2 min 1
    May 27 09:19:38 :: GuildWar: started GID1 1 GID2 3 0 time -1 min 1
    May 27 09:19:39 :: GuildWar: started GID1 1 GID2 3 0 time 0 min 0
    May 27 09:19:41 :: [      600] return 0/0/0 async 0/0/0
    May 27 09:19:41 :: Current Peer host names...
    127.0.0.1 13009 channel : 1
    127.0.0.1 13002 channel : 1
    127.0.0.1 0 channel : 0
    127.0.0.1 13001 channel : 1
    127.0.0.1 13000 channel : 1

    May 27 09:19:44 :: GuildWar: StartWar(1,1,3)
    May 27 09:19:44 :: GuildWar: GUILD sending start of wait start war 1 3
    May 27 09:19:46 :: [      650] return 0/0/0 async 0/0/0
    May 27 09:19:49 :: Connection closed. (host: 127.0.0.1)
    May 27 09:19:49 :: ItemIDRange: returned. 70000001 ~ 80000000
    May 27 09:19:49 :: ItemIDRange: Build: 70000001 ~ 80000000 start:70000001
    SYSERR: May 27 09:19:49 :: Process: FDWATCH: peer null in event: ident 21
    May 27 09:19:49 :: SetPlay off 1721411863 kign
    May 27 09:19:49 :: SetPlay off 1690695684 king
    May 27 09:19:49 :: Connection closed. (host: 127.0.0.1)
    May 27 09:19:49 :: ItemIDRange: returned. 10000001 ~ 20000000
    May 27 09:19:49 :: ItemIDRange: Build: 10000001 ~ 20000000 start:10000117
    May 27 09:19:49 :: Connection closed. (host: 127.0.0.1)
    May 27 09:19:49 :: ItemIDRange: returned. 30000001 ~ 40000000
    May 27 09:19:49 :: ItemIDRange: Build: 30000001 ~ 40000000 start:30000002
    SYSERR: May 27 09:19:50 :: Process: FDWATCH: peer null in event: ident 17
    SYSERR: May 27 09:19:50 :: Process: FDWATCH: peer null in event: ident 18
    May 27 09:19:50 :: Connection closed. (host: 127.0.0.1)
    May 27 09:19:50 :: ItemIDRange: returned. 50000001 ~ 60000000
    May 27 09:19:50 :: ItemIDRange: Build: 50000001 ~ 60000000 start:50000001
    SYSERR: May 27 09:19:50 :: Process: FDWATCH: peer null in event: ident 20
    May 27 09:19:51 :: [      700] return 0/0/0 async 0/0/0
    May 27 09:19:56 :: [      750] return 0/0/0 async 0/0/0
    May 27 09:20:01 :: [      800] return 0/0/0 async 0/0/0
    May 27 09:20:06 :: [      850] return 0/0/0 async 0/0/0
    May 27 09:20:11 :: [      900] return 0/0/0 async 0/0/0
    May 27 09:20:16 :: [      950] return 0/0/0 async 0/0/0
    May 27 09:20:21 :: [     1000] return 0/0/0 async 0/0/0
    May 27 09:20:26 :: [     1050] return 0/0/0 async 0/0/0
    May 27 09:20:31 :: [     1100] return 0/0/0 async 0/0/0
    May 27 09:20:36 :: [     1150] return 0/0/0 async 0/0/0
    May 27 09:20:41 :: [     1200] return 0/0/0 async 0/0/0
    May 27 09:20:41 :: Current Peer host names...
    127.0.0.1 0 channel : 0

     

  8. On 2/1/2017 at 1:47 PM, Human said:

    I solved it ... its with DB i corrected it 
    but i got another bug 
    pet name which i specified as (XXX0 is not showing 
    rather it shows Mini Nemere , Mini Monkey etc... 
    The name is in database newpetsystem table event in petinformation window but the summoned pet is having Mini Monkey or default 

    anyone can help me with this ? 

    thanks

     

     

    how to solved this problem ?

    On 1/30/2017 at 6:19 AM, Human said:

    Hello everyone, 
    Well i installed the official pet system it was working smooth on my server wtihout any bug but when i try the same in my VDI it causing game core crash when i click the pet say 55401 click pet is summoned and then game crash ch1 

    this is game.core error 

     

      Reveal hidden contents

    Loaded symbols for /usr/lib/libsupc++.so.1


    Reading symbols from /libexec/ld-elf.so.1...done.
    Loaded symbols for /libexec/ld-elf.so.1
    #0  0x08273b4e in CNewPetActor::Unsummon (this=0x463be180)
        at New_PetSystem.cpp:461
    461                     DBManager::instance().DirectQuery("UPDATE new_petsystem                                                   SET level = %d, evolution=%d, exp=%d, expi=%d, bonus0=%d, bonus1=%d, bonus2=%d,                                                   skill0=%d, skill0lv= %d, skill1=%d, skill1lv= %d, skill2=%d, skill2lv= %d, durat                                                  ion=%d, tduration=%d WHERE id = %lu ", this->GetLevel(), this->m_dwevolution, th                                                  is->GetExp(), this->GetExpI(), this->m_dwbonuspet[0][1], this->m_dwbonuspet[1][1                                                  ], this->m_dwbonuspet[2][1], this->m_dwskillslot[0], this->m_dwskill[0], this->m                                                  _dwskillslot[1], this->m_dwskill[1], this->m_dwskillslot[2], this->m_dwskill[2],                                                   this->m_dwduration, this->m_dwtduration, ITEM_MANAGER::instance().FindByVID(thi                                                  s->GetSummonItemVID())->GetID());
    [New Thread 29005500 (LWP 100158/game)]
    [New Thread 29005200 (LWP 100156/game)]
    [New Thread 29004f00 (LWP 100155/game)]
    [New Thread 29004300 (LWP 100115/game)]
    (gdb) bt full
    #0  0x08273b4e in CNewPetActor::Unsummon (this=0x463be180)
        at New_PetSystem.cpp:461
            pSummonItem = <value optimized out>
    #1  0x08274ae8 in CNewPetActor::Update (this=0x463be180, deltaTime=0)
        at New_PetSystem.cpp:740
    No locals.
    #2  0x082758eb in CNewPetSystem::Update (this=0x463f32c0, deltaTime=0)
        at New_PetSystem.cpp:1007
            petActor = (CNewPetActor *) 0x463be180
            bResult = true
            currentTime = 85895
            v_garbageActor = {<std::_Vector_base<CNewPetActor*,std::allocator<CNewPetActor*> >> = {
        _M_impl = {<std::allocator<CNewPetActor*>> = {<__gnu_cxx::new_allocator<CNewPetActor*>> = {<No data fie                       lds>}, <No data fields>}, _M_start = 0x0,
          _M_finish = 0x0, _M_end_of_storage = 0x0}}, <No data fields>}
    #3  0x082759b9 in newpetsystem_update_event (event=@0xbfbfb2bc,
        processing_time=6) at New_PetSystem.cpp:49
            pPetSystem = <value optimized out>
            __FUNCTION__ = "newpetsystem_update_event"
    #4  0x08125d61 in event_process (pulse=2148) at event.cpp:140
            pElem = <value optimized out>
            the_event = {px = 0x464db8a0}
    ---Type <return> to continue, or q <return> to quit---

     

    any one find me solution 

    thanks 

    Regards 

    Human

     

  9. On 7/5/2016 at 10:42 AM, Krawbber said:

    Hy there , first of all i want to say that who wants to help me will do it.So please do not leave comments like leaked system or something like that.The crash is not always so i can't find the problem.i used gdb and that's what i found.

    #0  0x0820ef8f in CNewPetActor::Unsummon (this=this@entry=0x2e4c9040)
        at New_PetSystem.cpp:440
    440     New_PetSystem.cpp: No such file or directory.
    [Current thread is 1 (LWP 100448)]

    On line 440 is this query 

    DBManager::instance().DirectQuery("UPDATE new_petsystem SET level = %d, evolution=%d, exp=%d, expi=%d, bonus0=%d, bonus1=%d, bonus2=%d, skill0=%d, skill0lv= %d, skill1=%d, skill1lv= %d, skill2=%d, skill2lv= %d, duration=%d, tduration=%d WHERE id = %lu ", this->GetLevel(), this->m_dwevolution, this->GetExp(), this->GetExpI(), this->m_dwbonuspet[0][1], this->m_dwbonuspet[1][1], this->m_dwbonuspet[2][1], this->m_dwskillslot[0], this->m_dwskill[0], this->m_dwskillslot[1], this->m_dwskill[1], this->m_dwskillslot[2], this->m_dwskill[2], this->m_dwduration, this->m_dwtduration, ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetID()); this->ClearBuff(); Thank you!

    i have same problem

  10. Hey Guys i have a Problem.

    I would add new sash Item's with vnum 86001. to 86053

    I can add me this Item but i dont see the model ingame i see the icon and when i equipd the item i dont see the model.

    when this item the vnum 85001 has can see the model.

    and i edit code in src client in InstanceBase.cpp

    Spoiler

    void CInstanceBase::SetSash(DWORD dwSash)
    {
        if (!IsPC())
            return;
        
        if (IsPoly())
            return;
        
        dwSash += 85000;
        ClearSashEffect();
        
        float fSpecular = 65.0f;
        if (dwSash > 87000)
        {
            dwSash -= 2000;
            fSpecular += 35;
            
            m_dwSashEffect = EFFECT_REFINED + EFFECT_SASH;
            __EffectContainer_AttachEffect(m_dwSashEffect);
        }

      ........

     

    and edit code in src svn in item.cpp

    Spoiler

                                else if (GetSubType() == COSTUME_SASH)
                                {
                                    toSetValue -= 85000;
                                    if (GetSocket(SASH_ABSORPTION_SOCKET) >= SASH_EFFECT_FROM_ABS)
                                        toSetValue += 2000;
                                    
                                    toSetValue = (bAdd == true) ? toSetValue : 0;
                                    toSetPart = PART_SASH;
                                }

    and this in item list 

    Spoiler

    86001    WING    icon/item/86001.tga    d:/ymir work/item/wing/acce_05_86_001.gr2
    86002    WING    icon/item/86002.tga    d:/ymir work/item/wing/acce_05_86_002.gr2
    86003    WING    icon/item/86003.tga    d:/ymir work/item/wing/acce_05_86_003.gr2
    86004    WING    icon/item/86004.tga    d:/ymir work/item/wing/acce_05_86_004.gr2
    86005    WING    icon/item/86005.tga    d:/ymir work/item/wing/acce_06_86_005.gr2
    86006    WING    icon/item/86006.tga    d:/ymir work/item/wing/acce_06_86_006.gr2
    86007    WING    icon/item/86007.tga    d:/ymir work/item/wing/acce_06_86_007.gr2
    86008    WING    icon/item/86008.tga    d:/ymir work/item/wing/acce_06_86_008.gr2
    86011    WING    icon/item/86011.tga    d:/ymir work/item/wing/acce_07_86_011.gr2
    86012    WING    icon/item/86012.tga    d:/ymir work/item/wing/acce_07_86_012.gr2
    86013    WING    icon/item/86013.tga    d:/ymir work/item/wing/acce_07_86_013.gr2
    86014    WING    icon/item/86014.tga    d:/ymir work/item/wing/acce_07_86_014.gr2
    86015    WING    icon/item/86015.tga    d:/ymir work/item/wing/acce_08_86_015.gr2
    86016    WING    icon/item/86016.tga    d:/ymir work/item/wing/acce_08_86_016.gr2
    86017    WING    icon/item/86017.tga    d:/ymir work/item/wing/acce_08_86_017.gr2
    86018    WING    icon/item/86018.tga    d:/ymir work/item/wing/acce_08_86_018.gr2
    86021    WING    icon/item/86021.tga    d:/ymir work/item/wing/acce_09_86_021.gr2
    86022    WING    icon/item/86022.tga    d:/ymir work/item/wing/acce_09_86_022.gr2
    86023    WING    icon/item/86023.tga    d:/ymir work/item/wing/acce_09_86_023.gr2
    86024    WING    icon/item/86024.tga    d:/ymir work/item/wing/acce_09_86_024.gr2
    86025    WING    icon/item/86025.tga    d:/ymir work/item/wing/acce_10_86_025.gr2
    86026    WING    icon/item/86026.tga    d:/ymir work/item/wing/acce_10_86_026.gr2
    86027    WING    icon/item/86027.tga    d:/ymir work/item/wing/acce_10_86_027.gr2
    86028    WING    icon/item/86028.tga    d:/ymir work/item/wing/acce_10_86_028.gr2
    86031    WING    icon/item/86031.tga    d:/ymir work/item/wing/acce_11_86_031.gr2
    86032    WING    icon/item/86032.tga    d:/ymir work/item/wing/acce_11_86_032.gr2
    86033    WING    icon/item/86033.tga    d:/ymir work/item/wing/acce_11_86_033.gr2
    86034    WING    icon/item/86034.tga    d:/ymir work/item/wing/acce_11_86_034.gr2
    86035    WING    icon/item/86035.tga    d:/ymir work/item/wing/acce_12_86_035.gr2
    86036    WING    icon/item/86036.tga    d:/ymir work/item/wing/acce_12_86_036.gr2
    86037    WING    icon/item/86037.tga    d:/ymir work/item/wing/acce_12_86_037.gr2
    86038    WING    icon/item/86038.tga    d:/ymir work/item/wing/acce_12_86_038.gr2
    86041    WING    icon/item/86041.tga    d:/ymir work/item/wing/acce_13_86_041.gr2
    86042    WING    icon/item/86042.tga    d:/ymir work/item/wing/acce_13_86_042.gr2
    86043    WING    icon/item/86043.tga    d:/ymir work/item/wing/acce_13_86_043.gr2
    86044    WING    icon/item/86044.tga    d:/ymir work/item/wing/acce_13_86_044.gr2
    86045    WING    icon/item/86045.tga    d:/ymir work/item/wing/acce_14_86_045.gr2
    86046    WING    icon/item/86046.tga    d:/ymir work/item/wing/acce_14_86_046.gr2
    86047    WING    icon/item/86047.tga    d:/ymir work/item/wing/acce_14_86_047.gr2
    86048    WING    icon/item/86048.tga    d:/ymir work/item/wing/acce_14_86_048.gr2
    86051    WING    icon/item/86051.tga    d:/ymir work/item/wing/acce_15_86_051.gr2
    86052    WING    icon/item/86052.tga    d:/ymir work/item/wing/acce_15_86_052.gr2
    86053    WING    icon/item/86053.tga    d:/ymir work/item/wing/acce_15_86_053.gr2
    86054    WING    icon/item/86054.tga    d:/ymir work/item/wing/acce_15_86_054.gr2
    86055    WING    icon/item/86055.tga    d:/ymir work/item/wing/acce_16_86_055.gr2
    86056    WING    icon/item/86056.tga    d:/ymir work/item/wing/acce_16_86_056.gr2
    86057    WING    icon/item/86057.tga    d:/ymir work/item/wing/acce_16_86_057.gr2
    86058    WING    icon/item/86058.tga    d:/ymir work/item/wing/acce_16_86_058.gr2

    and this in item_proto all to 86058 like this

    Spoiler
    86001 sash1 ITEM_COSTUME COSTUME_SASH 1 ANTI_DROP | ANTI_SELL | ANTI_STACK | ANTI_PKDROP | ANTI_MYSHOP | ANTI_GIVE NONE NONE NONE 30000000 1 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 1 0 0 0 0 0 100 0 0
    86002 sash2 ITEM_COSTUME COSTUME_SASH 1 ANTI_DROP | ANTI_SELL | ANTI_STACK | ANTI_PKDROP | ANTI_MYSHOP | ANTI_GIVE NONE NONE NONE 30000000 1 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 2 0 0 0 0 0 100 0 0
    86003 sash3 ITEM_COSTUME COSTUME_SASH 1 ANTI_DROP | ANTI_SELL | ANTI_STACK | ANTI_PKDROP | ANTI_MYSHOP | ANTI_GIVE NONE NONE NONE 30000000 1 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 3 0 0 0 0 0 100 0 0
    86004 sash4 ITEM_COSTUME COSTUME_SASH 1 ANTI_DROP | ANTI_SELL | ANTI_STACK | ANTI_PKDROP NONE NONE NONE 1 1 0 0 0 LIMIT_NONE 0 LIMIT_NONE 0 APPLY_NONE 0 APPLY_NONE 0 APPLY_NONE 0 4 0 0 0 0 0 100 0 0

    and this is item_scale.txt

    Spoiler

    86001    JOB_ASSASSIN    M    73    73    73
    86001    JOB_ASSASSIN    F    54    65    62
    86001    JOB_SHAMAN    M    78    78    78
    86001    JOB_SHAMAN    F    62    62    62
    86001    JOB_SURA    M    85    85    85
    86001    JOB_SURA    F    62    62    62
    86001    JOB_WARRIOR    M    83    83    83
    86001    JOB_WARRIOR    F    72    75    72
    86005    JOB_ASSASSIN    M    73    73    73
    86005    JOB_ASSASSIN    F    54    65    62
    86005    JOB_SHAMAN    M    78    78    78
    86005    JOB_SHAMAN    F    62    62    62
    86005    JOB_SURA    M    85    85    85
    86005    JOB_SURA    F    62    62    62
    86005    JOB_WARRIOR    M    83    83    83
    86005    JOB_WARRIOR    F    72    75    72
    86011    JOB_ASSASSIN    M    73    73    73
    86011    JOB_ASSASSIN    F    54    65    62
    86011    JOB_SHAMAN    M    78    78    78
    86011    JOB_SHAMAN    F    62    62    62
    86011    JOB_SURA    M    85    85    85
    86011    JOB_SURA    F    62    62    62
    86011    JOB_WARRIOR    M    83    83    83
    86011    JOB_WARRIOR    F    72    75    72
    86015    JOB_ASSASSIN    M    73    73    73
    86015    JOB_ASSASSIN    F    54    65    62
    86015    JOB_SHAMAN    M    78    78    78
    86015    JOB_SHAMAN    F    62    62    62
    86015    JOB_SURA    M    85    85    85
    86015    JOB_SURA    F    62    62    62
    86015    JOB_WARRIOR    M    83    83    83
    86015    JOB_WARRIOR    F    72    75    72
    86021    JOB_ASSASSIN    M    73    73    73
    86021    JOB_ASSASSIN    F    54    65    62
    86021    JOB_SHAMAN    M    78    78    78
    86021    JOB_SHAMAN    F    62    62    62
    86021    JOB_SURA    M    85    85    85
    86021    JOB_SURA    F    62    62    62
    86021    JOB_WARRIOR    M    83    83    83
    86021    JOB_WARRIOR    F    72    75    72
    86025    JOB_ASSASSIN    M    73    73    73
    86025    JOB_ASSASSIN    F    54    65    62
    86025    JOB_SHAMAN    M    78    78    78
    86025    JOB_SHAMAN    F    62    62    62
    86025    JOB_SURA    M    85    85    85
    86025    JOB_SURA    F    62    62    62
    86025    JOB_WARRIOR    M    83    83    83
    86025    JOB_WARRIOR    F    72    75    72
    86031    JOB_ASSASSIN    M    73    73    73
    86031    JOB_ASSASSIN    F    54    65    62
    86031    JOB_SHAMAN    M    78    78    78
    86031    JOB_SHAMAN    F    62    62    62
    86031    JOB_SURA    M    85    85    85
    86031    JOB_SURA    F    62    62    62
    86031    JOB_WARRIOR    M    83    83    83
    86031    JOB_WARRIOR    F    72    75    72
    86035    JOB_ASSASSIN    M    73    73    73
    86035    JOB_ASSASSIN    F    54    65    62
    86035    JOB_SHAMAN    M    78    78    78
    86035    JOB_SHAMAN    F    62    62    62
    86035    JOB_SURA    M    85    85    85
    86035    JOB_SURA    F    62    62    62
    86035    JOB_WARRIOR    M    83    83    83
    86035    JOB_WARRIOR    F    72    75    72
    86041    JOB_ASSASSIN    M    73    73    73
    86041    JOB_ASSASSIN    F    54    65    62
    86041    JOB_SHAMAN    M    78    78    78
    86041    JOB_SHAMAN    F    62    62    62
    86041    JOB_SURA    M    85    85    85
    86041    JOB_SURA    F    62    62    62
    86041    JOB_WARRIOR    M    83    83    83
    86041    JOB_WARRIOR    F    72    75    72
    86045    JOB_ASSASSIN    M    73    73    73
    86045    JOB_ASSASSIN    F    54    65    62
    86045    JOB_SHAMAN    M    78    78    78
    86045    JOB_SHAMAN    F    62    62    62
    86045    JOB_SURA    M    85    85    85
    86045    JOB_SURA    F    62    62    62
    86045    JOB_WARRIOR    M    83    83    83
    86045    JOB_WARRIOR    F    72    75    72
    86051    JOB_ASSASSIN    M    73    73    73
    86051    JOB_ASSASSIN    F    54    65    62
    86051    JOB_SHAMAN    M    78    78    78
    86051    JOB_SHAMAN    F    62    62    62
    86051    JOB_SURA    M    85    85    85
    86051    JOB_SURA    F    62    62    62
    86051    JOB_WARRIOR    M    83    83    83
    86051    JOB_WARRIOR    F    72    75    72
    86055    JOB_ASSASSIN    M    73    73    73
    86055    JOB_ASSASSIN    F    54    65    62
    86055    JOB_SHAMAN    M    78    78    78
    86055    JOB_SHAMAN    F    62    62    62
    86055    JOB_SURA    M    85    85    85
    86055    JOB_SURA    F    62    62    62
    86055    JOB_WARRIOR    M    83    83    83
    86055    JOB_WARRIOR    F    72    75    72

     

  11. Spoiler

    class GuildWindow(ui.ScriptWindow):

        JOB_NAME = {    0 : localeInfo.JOB_WARRIOR,
                1 : localeInfo.JOB_ASSASSIN,
                2 : localeInfo.JOB_SURA,
                3 : localeInfo.JOB_SHAMAN, }

        if app.ENABLE_WOLFMAN_CHARACTER:
            JOB_NAME.update({4 : localeInfo.JOB_WOLFMAN,})

        GUILD_SKILL_PASSIVE_SLOT = 0
        GUILD_SKILL_ACTIVE_SLOT = 1
        GUILD_SKILL_AFFECT_SLOT = 2

        GRADE_SLOT_NAME = 0
        GRADE_ADD_MEMBER_AUTHORITY = 1
        GRADE_REMOVE_MEMBER_AUTHORITY = 2
        GRADE_NOTICE_AUTHORITY = 3
        GRADE_SKILL_AUTHORITY = 4

        MEMBER_LINE_COUNT = 13

        class PageWindow(ui.ScriptWindow):
            def __init__(self, parent, filename):
                ui.ScriptWindow.__init__(self)
                self.SetParent(parent)
                self.filename = filename
            def GetScriptFileName(self):
                return self.filename

        def __init__(self):
            ui.ScriptWindow.__init__(self)
            self.isLoaded=0

            self.__Initialize()

        def __del__(self):
            ui.ScriptWindow.__del__(self)
            print " ==================================== DESTROIED GUILD WINDOW"

        def __Initialize(self):

            self.board = None
            self.pageName = None
            self.tabDict = None
            self.tabButtonDict = None
            self.pickDialog = None
            self.questionDialog = None
            self.offerDialog = None
            self.popupDialog = None
            self.moneyDialog = None
            self.changeGradeNameDialog = None
            self.popup = None

            self.popupMessage = None
            self.commentSlot = None

            self.pageWindow = None
            self.tooltipSkill = None

            self.memberLinePos = 0

            self.enemyGuildNameList = []

        def Open(self):
            self.Show()
            self.SetTop()

            guildID = net.GetGuildID()
            self.largeMarkBox.SetIndex(guildID)
            self.largeMarkBox.SetScale(3)

        def Close(self):
            self.__CloseAllGuildMemberPageGradeComboBox()
            self.offerDialog.Close()
            self.popupDialog.Hide()
            self.changeGradeNameDialog.Hide()
            self.tooltipSkill.Hide()
            self.Hide()

            self.pickDialog = None
            self.questionDialog = None
            self.popup = None

        def Destroy(self):
            self.ClearDictionary()

            if self.offerDialog:
                self.offerDialog.Destroy()

            if self.popupDialog:
                self.popupDialog.ClearDictionary()

            if self.changeGradeNameDialog:
                self.changeGradeNameDialog.ClearDictionary()

            if self.pageWindow:
                for window in self.pageWindow.values():
                    window.ClearDictionary()

            self.__Initialize()

        def Show(self):
            if self.isLoaded==0:
                self.isLoaded=1

                self.__LoadWindow()

            self.RefreshGuildInfoPage()
            self.RefreshGuildBoardPage()
            self.RefreshGuildMemberPage()
            self.RefreshGuildSkillPage()
            self.RefreshGuildGradePage()

            ui.ScriptWindow.Show(self)

        def __LoadWindow(self):
            global DISABLE_GUILD_SKILL
            try:
                pyScrLoader = ui.PythonScriptLoader()

                if localeInfo.IsARABIC() :
                    pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow.py")
                else:
                    pyScrLoader.LoadScriptFile(self, "uiscript/guildwindow.py")

                self.popupDialog = ui.ScriptWindow()
                pyScrLoader.LoadScriptFile(self.popupDialog, "UIScript/PopupDialog.py")

                self.changeGradeNameDialog = ChangeGradeNameDialog()
                pyScrLoader.LoadScriptFile(self.changeGradeNameDialog, "uiscript/changegradenamedialog.py")

                if localeInfo.IsARABIC():
                    self.pageWindow = {
                        "GUILD_INFO"    : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
                        "BOARD"            : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
                        "MEMBER"        : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
                        "BASE_INFO"        : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
                        "SKILL"            : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"),
                        "GRADE"            : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
                    }
                elif localeInfo.IsJAPAN() :
                    self.pageWindow = {
                        "GUILD_INFO"    : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildinfopage.py"),
                        "BOARD"            : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_boardpage.py"),
                        "MEMBER"        : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_memberpage.py"),
                        "BASE_INFO"        : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
                        "SKILL"            : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
                        "GRADE"            : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
                    }
                elif localeInfo.IsVIETNAM() :   # 다표시
                    self.pageWindow = {
                        "GUILD_INFO"    : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
                        "BOARD"            : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
                        "MEMBER"        : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
                        "BASE_INFO"        : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
                        "SKILL"            : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"),
                        "GRADE"            : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
                    }
                elif localeInfo.IsEUROPE() and not app.GetLocalePath() == "locale/ca" :
                    self.pageWindow = {
                        "GUILD_INFO"    : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
                        "BOARD"            : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
                        "MEMBER"        : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
                        "BASE_INFO"        : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
                        "SKILL"            : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
                        "GRADE"            : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
                    }
                else:
                    self.pageWindow = {
                        "GUILD_INFO"    : self.PageWindow(self, "uiscript/guildwindow_guildinfopage.py"),
                        "BOARD"            : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
                        "MEMBER"        : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
                        "BASE_INFO"        : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
                        "SKILL"            : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
                        "GRADE"            : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
                    }

                for window in self.pageWindow.values():
                    pyScrLoader.LoadScriptFile(window, window.GetScriptFileName())

            except:
                import exception
                exception.Abort("GuildWindow.__LoadWindow.LoadScript")

            try:
                getObject = self.GetChild

                self.board = getObject("Board")
                self.pageName = {
                    "GUILD_INFO"    : localeInfo.GUILD_TILE_INFO,
                    "BOARD"            : localeInfo.GUILD_TILE_BOARD,
                    "MEMBER"        : localeInfo.GUILD_TILE_MEMBER,
                    "BASE_INFO"        : localeInfo.GUILD_TILE_BASEINFO,
                    "SKILL"            : localeInfo.GUILD_TILE_SKILL,
                    "GRADE"            : localeInfo.GUILD_TILE_GRADE,
                }

                self.tabDict = {
                    "GUILD_INFO"    : getObject("Tab_01"),
                    "BOARD"            : getObject("Tab_02"),
                    "MEMBER"        : getObject("Tab_03"),
                    "BASE_INFO"        : getObject("Tab_04"),
                    "SKILL"            : getObject("Tab_05"),
                    "GRADE"            : getObject("Tab_06"),
                }
                self.tabButtonDict = {
                    "GUILD_INFO"    : getObject("Tab_Button_01"),
                    "BOARD"            : getObject("Tab_Button_02"),
                    "MEMBER"        : getObject("Tab_Button_03"),
                    "BASE_INFO"        : getObject("Tab_Button_04"),
                    "SKILL"            : getObject("Tab_Button_05"),
                    "GRADE"            : getObject("Tab_Button_06"),
                }

                ## QuestionDialog
                self.popupMessage = self.popupDialog.GetChild("message")
                self.popupDialog.GetChild("accept").SetEvent(ui.__mem_func__(self.popupDialog.Hide))

                ## ChangeGradeName
                self.changeGradeNameDialog.GetChild("AcceptButton").SetEvent(ui.__mem_func__(self.OnChangeGradeName))
                self.changeGradeNameDialog.GetChild("CancelButton").SetEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide))
                self.changeGradeNameDialog.GetChild("Board").SetCloseEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide))
                self.changeGradeNameDialog.gradeNameSlot = self.changeGradeNameDialog.GetChild("GradeNameValue")
                self.changeGradeNameDialog.gradeNameSlot.OnIMEReturn = ui.__mem_func__(self.OnChangeGradeName)
                self.changeGradeNameDialog.gradeNameSlot.OnPressEscapeKey = ui.__mem_func__(self.changeGradeNameDialog.Close)

                ## Comment
                self.commentSlot = self.pageWindow["BOARD"].GetChild("CommentValue")
                self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment)
                #self.commentSlot.OnKeyDown = ui.__mem_func__(self.OnKeyDownInBoardPage)
                self.commentSlot.OnKeyDown = lambda key, argSelf=self: argSelf.OnKeyDownInBoardPage(key)

                ## RefreshButton
                self.pageWindow["BOARD"].GetChild("RefreshButton").SetEvent(ui.__mem_func__(self.OnRefreshComments))

                ## ScrollBar
                scrollBar = self.pageWindow["MEMBER"].GetChild("ScrollBar")
                scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScrollMemberLine))
                self.pageWindow["MEMBER"].scrollBar = scrollBar

            except:
                import exception
                exception.Abort("GuildWindow.__LoadWindow.BindObject")

            self.__MakeInfoPage()
            self.__MakeBoardPage()
            self.__MakeMemberPage()
            self.__MakeBaseInfoPage()
            self.__MakeSkillPage()
            self.__MakeGradePage()

            for page in self.pageWindow.values():
                page.UpdateRect()

            for key, btn in self.tabButtonDict.items():
                btn.SetEvent(self.SelectPage, key)

            self.tabButtonDict["BASE_INFO"].Disable()

            if DISABLE_GUILD_SKILL:
                self.tabButtonDict["SKILL"].Disable()

            self.board.SetCloseEvent(ui.__mem_func__(self.Close))
            self.board.SetTitleColor(0xffffffff)
            self.SelectPage("GUILD_INFO")

            #self.offerDialog = uiPickMoney.PickMoneyDialog()
            self.offerDialog = uiPickMoney.PickMoneyWithoutWon()
            self.offerDialog.LoadDialog()
            self.offerDialog.SetMax(9)
            self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP)
            self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer))

        def __MakeInfoPage(self):
            page = self.pageWindow["GUILD_INFO"]

            try:
                page.nameSlot = page.GetChild("GuildNameValue")
                page.masterNameSlot = page.GetChild("GuildMasterNameValue")
                page.guildLevelSlot = page.GetChild("GuildLevelValue")
                page.curExpSlot = page.GetChild("CurrentExperienceValue")
                page.lastExpSlot = page.GetChild("LastExperienceValue")
                page.memberCountSlot = page.GetChild("GuildMemberCountValue")
                page.levelAverageSlot = page.GetChild("GuildMemberLevelAverageValue")
                page.uploadMarkButton = page.GetChild("UploadGuildMarkButton")
                page.uploadSymbolButton = page.GetChild("UploadGuildSymbolButton")
                page.declareWarButton = page.GetChild("DeclareWarButton")

                try:
                    page.guildMoneySlot = page.GetChild("GuildMoneyValue")
                except KeyError:
                    page.guildMoneySlot = None

                try:
                    page.GetChild("DepositButton").SetEvent(ui.__mem_func__(self.__OnClickDepositButton))
                    page.GetChild("WithdrawButton").SetEvent(ui.__mem_func__(self.__OnClickWithdrawButton))
                except KeyError:
                    pass

                page.uploadMarkButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildMarkButton))
                page.uploadSymbolButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildSymbolButton))
                page.declareWarButton.SetEvent(ui.__mem_func__(self.__OnClickDeclareWarButton))
                page.GetChild("OfferButton").SetEvent(ui.__mem_func__(self.__OnClickOfferButton))
                page.GetChild("EnemyGuildCancel1").Hide()
                page.GetChild("EnemyGuildCancel2").Hide()
                page.GetChild("EnemyGuildCancel3").Hide()
                page.GetChild("EnemyGuildCancel4").Hide()
                page.GetChild("EnemyGuildCancel5").Hide()
                page.GetChild("EnemyGuildCancel6").Hide()

                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName1"))
                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName2"))
                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName3"))
                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName4"))
                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName5"))
                self.enemyGuildNameList.append(page.GetChild("EnemyGuildName6"))

                self.largeMarkBox = page.GetChild("LargeGuildMark")
            except:
                import exception
                exception.Abort("GuildWindow.__MakeInfoPage")

            self.largeMarkBox.AddFlag("not_pick")

            self.markSelectDialog=uiUploadMark.MarkSelectDialog()
            self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark)

            self.symbolSelectDialog=uiUploadMark.SymbolSelectDialog()
            self.symbolSelectDialog.SAFE_SetSelectEvent(self.__OnSelectSymbol)


        def __MakeBoardPage(self):

            i = 0
            lineStep = 20
            page = self.pageWindow["BOARD"]

            page.boardDict = {}

            for i in xrange(12):

                yPos = 25 + i * lineStep

                ## NoticeMark
                if localeInfo.IsJAPAN():
                    noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 15, yPos+3)
                else:
                    noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 5, yPos+3)
                noticeMarkImage.Hide()
                page.Children.append(noticeMarkImage)

                ## Name
                ## 13.12.02 아랍수정
                if localeInfo.IsJAPAN():
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 9, yPos)
                elif localeInfo.IsARABIC():
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 255, yPos)
                else:
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 15, yPos)
                nameSlot = ui.MakeTextLine(nameSlotImage)
                page.Children.append(nameSlotImage)
                page.Children.append(nameSlot)

                ## Delete Button
                if localeInfo.IsARABIC():
                    deleteButton = ui.MakeButton(page, 3, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
                else:
                    deleteButton = ui.MakeButton(page, 340, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
                deleteButton.SetEvent(ui.__mem_func__(self.OnDeleteComment), i)
                page.Children.append(deleteButton)

                ## Comment
                ## 13.12.02 아랍수정
                commentSlot = CommentSlot()
                commentSlot.SetParent(page)
                if localeInfo.IsARABIC():
                    commentSlot.SetPosition(25, yPos)
                else:
                    commentSlot.SetPosition(114, yPos)
                commentSlot.Show()
                page.Children.append(commentSlot)

                boardSlotList = []
                boardSlotList.append(noticeMarkImage)
                boardSlotList.append(nameSlot)
                boardSlotList.append(commentSlot)
                page.boardDict = boardSlotList

            ## PostComment - Have to make this here for that fit tooltip's position.
            ## 13.12.02 아랍수정
            if localeInfo.IsARABIC():
                postCommentButton = ui.MakeButton(page, 3, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
            else:
                postCommentButton = ui.MakeButton(page, 337, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
            postCommentButton.SetEvent(ui.__mem_func__(self.OnPostComment))
            page.Children.append(postCommentButton)

        def __MakeMemberPage(self):

            page = self.pageWindow["MEMBER"]

            lineStep = 20
            page.memberDict = {}

            for i in xrange(self.MEMBER_LINE_COUNT):

                inverseLineIndex = self.MEMBER_LINE_COUNT - i - 1
                yPos = 28 + inverseLineIndex*lineStep
                ## 13.12.02 아랍 수정
                ## Name
                if localeInfo.IsJAPAN():
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 15, yPos)
                elif localeInfo.IsARABIC():
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 255, yPos)
                else:
                    nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 10, yPos)
                nameSlot = ui.MakeTextLine(nameSlotImage)
                page.Children.append(nameSlotImage)
                page.Children.append(nameSlot)

                ## Grade
                gradeSlot = ui.ComboBox()
                gradeSlot.SetParent(page)
                if localeInfo.IsJAPAN():
                    gradeSlot.SetPosition(117, yPos-1)
                elif localeInfo.IsARABIC():
                    gradeSlot.SetPosition(192, yPos-1)
                else:
                    gradeSlot.SetPosition(101, yPos-1)
                gradeSlot.SetSize(61, 18)
                gradeSlot.SetEvent(lambda gradeNumber, lineIndex=inverseLineIndex, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber))
                gradeSlot.Show()
                page.Children.append(gradeSlot)

                ## Job
                if localeInfo.IsJAPAN():
                    jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 181, yPos)
                elif localeInfo.IsARABIC():
                    jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 145, yPos)
                else:
                    jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 170, yPos)
                jobSlot = ui.MakeTextLine(jobSlotImage)
                page.Children.append(jobSlotImage)
                page.Children.append(jobSlot)

                ## Level
                if localeInfo.IsJAPAN():
                    levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 221, yPos)
                elif localeInfo.IsARABIC():
                    levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 106, yPos)
                else:
                    levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 210, yPos)
                levelSlot = ui.MakeTextLine(levelSlotImage)
                page.Children.append(levelSlotImage)
                page.Children.append(levelSlot)

                ## Offer
                if localeInfo.IsJAPAN():
                    offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 261, yPos)
                elif localeInfo.IsARABIC():
                    offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 66, yPos)
                else:
                    offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 250, yPos)
                offerSlot = ui.MakeTextLine(offerSlotImage)
                page.Children.append(offerSlotImage)
                page.Children.append(offerSlot)

                ## General Enable
                event = lambda argSelf=proxy(self), argIndex=inverseLineIndex: apply(argSelf.OnEnableGeneral, (argIndex,))
                if localeInfo.IsJAPAN():
                    generalEnableCheckBox = CheckBox(page, 307, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
                elif localeInfo.IsARABIC():
                    generalEnableCheckBox = CheckBox(page, 22, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
                else:
                    generalEnableCheckBox = CheckBox(page, 297, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
                page.Children.append(generalEnableCheckBox)

                memberSlotList = []
                memberSlotList.append(nameSlot)
                memberSlotList.append(gradeSlot)
                memberSlotList.append(jobSlot)
                memberSlotList.append(levelSlot)
                memberSlotList.append(offerSlot)
                memberSlotList.append(generalEnableCheckBox)
                page.memberDict[inverseLineIndex] = memberSlotList

        def __MakeBaseInfoPage(self):

            page = self.pageWindow["BASE_INFO"]

            page.buildingDataDict = {}

            lineStep = 20
            GUILD_BUILDING_MAX_NUM = 7

            yPos = 95 + 35

            for i in xrange(GUILD_BUILDING_MAX_NUM):

                nameSlotImage = ui.MakeSlotBar(page, 15, yPos, 78, 17)
                nameSlot = ui.MakeTextLine(nameSlotImage)
                page.Children.append(nameSlotImage)
                page.Children.append(nameSlot)
                nameSlot.SetText(localeInfo.GUILD_BUILDING_NAME)

                gradeSlotImage = ui.MakeSlotBar(page, 99, yPos, 26, 17)
                gradeSlot = ui.MakeTextLine(gradeSlotImage)
                page.Children.append(gradeSlotImage)
                page.Children.append(gradeSlot)
                gradeSlot.SetText(localeInfo.GUILD_BUILDING_GRADE)

                RESOURCE_MAX_NUM = 6
                for j in xrange(RESOURCE_MAX_NUM):
                    resourceSlotImage = ui.MakeSlotBar(page, 131 + 29*j, yPos, 26, 17)
                    resourceSlot = ui.MakeTextLine(resourceSlotImage)
                    page.Children.append(resourceSlotImage)
                    page.Children.append(resourceSlot)
                    resourceSlot.SetText(localeInfo.GUILD_GEM)

                event = lambda *arg: None
                powerSlot = CheckBox(page, 308, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
                page.Children.append(powerSlot)

                yPos += lineStep

        def __MakeSkillPage(self):

            page = self.pageWindow["SKILL"]

            page.skillPoint = page.GetChild("Skill_Plus_Value")
            page.passiveSlot = page.GetChild("Passive_Skill_Slot_Table")
            page.activeSlot = page.GetChild("Active_Skill_Slot_Table")
            page.affectSlot = page.GetChild("Affect_Slot_Table")
            page.gpGauge = page.GetChild("Dragon_God_Power_Gauge")
            page.gpValue = page.GetChild("Dragon_God_Power_Value")
            page.btnHealGSP = page.GetChild("Heal_GSP_Button")

            page.activeSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
            page.activeSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type))
            page.activeSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
            page.activeSlot.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type))
            page.activeSlot.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type))
            page.activeSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
            page.activeSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
                                            "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
                                            "d:/ymir work/ui/game/windows/btn_plus_down.sub")
            page.passiveSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
            page.passiveSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OverInItem(slotNumber, type))
            page.passiveSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
            page.passiveSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
            page.passiveSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
                                            "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
                                            "d:/ymir work/ui/game/windows/btn_plus_down.sub")
            page.affectSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
            page.affectSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_AFFECT_SLOT: self.OverInItem(slotNumber, type))
            page.affectSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
            page.btnHealGSP.SetEvent(ui.__mem_func__(self.__OnOpenHealGSPBoard))

            ## Passive
            """
            for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)):

                slotIndex = page.passiveSlot.GetStartIndex()+i
                skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST

                page.passiveSlot.SetSkillSlot(slotIndex, skillIndex, 0)
                page.passiveSlot.RefreshSlot()
                guild.SetSkillIndex(slotIndex, i)
            """

            ## Active
            for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):

                slotIndex = page.activeSlot.GetStartIndex()+i
                skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST

                page.activeSlot.SetSkillSlot(slotIndex, skillIndex, 0)
                page.activeSlot.SetCoverButton(slotIndex)
                page.activeSlot.RefreshSlot()
                guild.SetSkillIndex(slotIndex, len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)+i)

        def __MakeGradePage(self):

            lineStep = 18
            page = self.pageWindow["GRADE"]

            page.gradeDict = {}

            for i in xrange(15):

                yPos = 22 + i*lineStep
                index = i+1
                ## 13.12.02 아랍 수정
                ## GradeNumber
                if localeInfo.IsARABIC():
                    gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 310, yPos)
                else:
                    gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 14, yPos)
                gradeNumberSlot = ui.MakeTextLine(gradeNumberSlotImage)
                gradeNumberSlot.SetText(str(i+1))
                page.Children.append(gradeNumberSlotImage)
                page.Children.append(gradeNumberSlot)

                ## GradeName
                if localeInfo.IsARABIC():
                    gradeNameSlot = EditableTextSlot(page, 242, yPos)
                else:
                    gradeNameSlot = EditableTextSlot(page, 58, yPos)
                gradeNameSlot.SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), index)
                page.Children.append(gradeNameSlot)

                ## Invite Authority
                event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
                if localeInfo.IsARABIC():
                    inviteAuthorityCheckBox = CheckBox(page, 185, yPos, event)
                else:
                    inviteAuthorityCheckBox = CheckBox(page, 124, yPos, event)
                page.Children.append(inviteAuthorityCheckBox)

                ## DriveOut Authority
                event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
                if localeInfo.IsARABIC():
                    driveoutAuthorityCheckBox = CheckBox(page, 128, yPos, event)
                else:
                    driveoutAuthorityCheckBox = CheckBox(page, 181, yPos, event)
                page.Children.append(driveoutAuthorityCheckBox)

                ## Notice Authority
                event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
                if localeInfo.IsARABIC():
                    noticeAuthorityCheckBox = CheckBox(page, 71, yPos, event)
                else:
                    noticeAuthorityCheckBox = CheckBox(page, 238, yPos, event)
                page.Children.append(noticeAuthorityCheckBox)

                ## Skill Authority
                event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
                if localeInfo.IsARABIC():
                    skillAuthorityCheckBox = CheckBox(page, 14, yPos, event)
                else:
                    skillAuthorityCheckBox = CheckBox(page, 295, yPos, event)
                page.Children.append(skillAuthorityCheckBox)

                gradeSlotList = []
                gradeSlotList.append(gradeNameSlot)
                gradeSlotList.append(inviteAuthorityCheckBox)
                gradeSlotList.append(driveoutAuthorityCheckBox)
                gradeSlotList.append(noticeAuthorityCheckBox)
                gradeSlotList.append(skillAuthorityCheckBox)
                page.gradeDict[index] = gradeSlotList

            masterSlotList = page.gradeDict[1]
            for slot in masterSlotList:
                slot.Disable()

        def CanOpen(self):
            return guild.IsGuildEnable()

        def Open(self):
            self.Show()
            self.SetTop()

            guildID = net.GetGuildID()
            self.largeMarkBox.SetIndex(guildID)
            self.largeMarkBox.SetScale(3)
            ## 13.12.02 아랍수정
            if localeInfo.IsARABIC():
                self.largeMarkBox.SetPosition(self.largeMarkBox.GetWidth()+32,1)

        def Close(self):
            self.__CloseAllGuildMemberPageGradeComboBox()
            self.offerDialog.Close()
            self.popupDialog.Hide()
            self.changeGradeNameDialog.Hide()
            self.Hide()

            if self.tooltipSkill:
                self.tooltipSkill.Hide()

            self.pickDialog = None
            self.questionDialog = None
            self.moneyDialog = None

        def Destroy(self):
            self.ClearDictionary()
            self.board = None
            self.pageName = None
            self.tabDict = None
            self.tabButtonDict = None
            self.pickDialog = None
            self.questionDialog = None
            self.markSelectDialog = None
            self.symbolSelectDialog = None

            if self.offerDialog:
                self.offerDialog.Destroy()
                self.offerDialog = None

            if self.popupDialog:
                self.popupDialog.ClearDictionary()
                self.popupDialog = None

            if self.changeGradeNameDialog:
                self.changeGradeNameDialog.ClearDictionary()
                self.changeGradeNameDialog = None

            self.popupMessage = None
            self.commentSlot = None

            if self.pageWindow:
                for window in self.pageWindow.values():
                    window.ClearDictionary()

            self.pageWindow = None
            self.tooltipSkill = None
            self.moneyDialog = None

            self.enemyGuildNameList = []

        def DeleteGuild(self):
            self.RefreshGuildInfoPage()
            self.RefreshGuildBoardPage()
            self.RefreshGuildMemberPage()
            self.RefreshGuildSkillPage()
            self.RefreshGuildGradePage()
            self.Hide()

        def SetSkillToolTip(self, tooltipSkill):
            self.tooltipSkill = tooltipSkill

        def SelectPage(self, arg):

            if "BOARD" == arg:
                self.OnRefreshComments()

            for key, btn in self.tabButtonDict.items():
                if arg != key:
                    btn.SetUp()
            for key, img in self.tabDict.items():
                if arg == key:
                    img.Show()
                else:
                    img.Hide()
            for key, page in self.pageWindow.items():
                if arg == key:
                    page.Show()
                else:
                    page.Hide()
            self.board.SetTitleName(self.pageName[arg])
            self.__CloseAllGuildMemberPageGradeComboBox()

        def __CloseAllGuildMemberPageGradeComboBox(self):

            page = self.pageWindow["MEMBER"]
            for key, slotList in page.memberDict.items():
                slotList[1].CloseListBox()

        def RefreshGuildInfoPage(self):

            if self.isLoaded==0:
                return

            global DISABLE_DECLARE_WAR
            page = self.pageWindow["GUILD_INFO"]
            page.nameSlot.SetText(guild.GetGuildName())
            page.masterNameSlot.SetText(guild.GetGuildMasterName())
            page.guildLevelSlot.SetText(str(guild.GetGuildLevel()))
            if page.guildMoneySlot:
                page.guildMoneySlot.SetText(str(guild.GetGuildMoney()))

            curExp, lastExp = guild.GetGuildExperience()
            curExp *= 100
            lastExp *= 100
            page.curExpSlot.SetText(str(curExp))
            page.lastExpSlot.SetText(str(lastExp))

            curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
            if maxMemberCount== 0xffff:
                page.memberCountSlot.SetText("%d / %s " % (curMemberCount, localeInfo.GUILD_MEMBER_COUNT_INFINITY))
            else:
                page.memberCountSlot.SetText("%d / %d" % (curMemberCount, maxMemberCount))

            page.levelAverageSlot.SetText(str(guild.GetGuildMemberLevelAverage()))

            ## 길드장만 길드 마크와 길드전 신청 버튼을 볼 수 있음
            mainCharacterName = player.GetMainCharacterName()
            masterName = guild.GetGuildMasterName()

            if mainCharacterName == masterName:
                page.uploadMarkButton.Show()

                if DISABLE_DECLARE_WAR:
                    page.declareWarButton.Hide()
                else:
                    page.declareWarButton.Show()

                if guild.HasGuildLand():
                    page.uploadSymbolButton.Show()
                else:
                    page.uploadSymbolButton.Hide()
            else:
                page.uploadMarkButton.Hide()
                page.declareWarButton.Hide()
                page.uploadSymbolButton.Hide()

            ## Refresh 시에 길드전 정보 업데이트
            for i in xrange(guild.ENEMY_GUILD_SLOT_MAX_COUNT):
                name = guild.GetEnemyGuildName(i)
                nameTextLine = self.enemyGuildNameList
                if name:
                    nameTextLine.SetText(name)
                else:
                    nameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY)

        def __GetGuildBoardCommentData(self, index):
            commentID, chrName, comment = guild.GetGuildBoardCommentData(index)
            if 0==commentID:
                if ""==chrName:
                    chrName=localeInfo.UI_NONAME
                if ""==comment:
                    comment=localeInfo.UI_NOCONTENTS

            return commentID, chrName, comment

        def RefreshGuildBoardPage(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["BOARD"]

            self.BOARD_LINE_MAX_NUM = 12
            lineIndex = 0

            commentCount = guild.GetGuildBoardCommentCount()
            for i in xrange(commentCount):

                commentID, chrName, comment = self.__GetGuildBoardCommentData(i)

                if not comment:
                    continue

                slotList = page.boardDict[lineIndex]

                if "!" == comment[0]:
                    slotList[0].Show()
                    slotList[1].SetText(chrName)
                    slotList[2].SetText(comment[1:])

                else:
                    slotList[0].Hide()
                    slotList[1].SetText(chrName)
                    slotList[2].SetText(comment)

                lineIndex += 1

            for i in xrange(self.BOARD_LINE_MAX_NUM - lineIndex):
                slotList = page.boardDict[lineIndex+i]
                slotList[0].Hide()
                slotList[1].SetText("")
                slotList[2].SetText("")

        def RefreshGuildMemberPage(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["MEMBER"]

            ## ScrollBar
            count = guild.GetMemberCount()
            if count > self.MEMBER_LINE_COUNT:
                page.scrollBar.SetMiddleBarSize(float(self.MEMBER_LINE_COUNT) / float(count))
                page.scrollBar.Show()
            else:
                page.scrollBar.Hide()
            self.RefreshGuildMemberPageGradeComboBox()
            self.RefreshGuildMemberPageMemberList()

        def RefreshGuildMemberPageMemberList(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["MEMBER"]

            for line, slotList in page.memberDict.items():

                gradeComboBox = slotList[1]
                gradeComboBox.Disable()

                if not guild.IsMember(line):
                    slotList[0].SetText("")
                    slotList[2].SetText("")
                    slotList[3].SetText("")
                    slotList[4].SetText("")
                    slotList[5].SetCheck(False)
                    continue

                pid, name, grade, race, level, offer, general = self.GetMemberData(line)
                if pid < 0:
                    continue

                job = chr.RaceToJob(race)

                guildExperienceSummary = guild.GetGuildExperienceSummary()

                offerPercentage = 0
                if guildExperienceSummary > 0:
                    offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)

                slotList[0].SetText(name)
                slotList[2].SetText(self.JOB_NAME.get(job, "?"))
                slotList[3].SetText(str(level))
                slotList[4].SetText(str(offerPercentage) + "%")
                slotList[5].SetCheck(general)
                gradeComboBox.SetCurrentItem(guild.GetGradeName(grade))
                if 1 != grade:
                    gradeComboBox.Enable()

        def RefreshGuildMemberPageGradeComboBox(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["MEMBER"]

            self.CAN_CHANGE_GRADE_COUNT = 15 - 1
            for key, slotList in page.memberDict.items():

                gradeComboBox = slotList[1]
                gradeComboBox.Disable()

                if not guild.IsMember(key):
                    continue

                pid, name, grade, job, level, offer, general = self.GetMemberData(key)
                if pid < 0:
                    continue

                gradeComboBox.ClearItem()
                for i in xrange(self.CAN_CHANGE_GRADE_COUNT):
                    gradeComboBox.InsertItem(i+2, guild.GetGradeName(i+2))
                gradeComboBox.SetCurrentItem(guild.GetGradeName(grade))
                if 1 != grade:
                    gradeComboBox.Enable()

        def RefreshGuildSkillPage(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["SKILL"]

            curPoint, maxPoint = guild.GetDragonPowerPoint()
            maxPoint = max(maxPoint, 1)
            page.gpValue.SetText(str(curPoint) + " / " + str(maxPoint))

            percentage = (float(curPoint) / float(maxPoint) * 100) * (float(173) / float(95))
            page.gpGauge.SetPercentage(int(percentage), 100)

            skillPoint = guild.GetGuildSkillPoint()
            page.skillPoint.SetText(str(skillPoint))

            page.passiveSlot.HideAllSlotButton()
            page.activeSlot.HideAllSlotButton()

            ## Passive
            """
            for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)):

                slotIndex = page.passiveSlot.GetStartIndex()+i
                skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST
                skillLevel = guild.GetSkillLevel(slotIndex)
                skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)

                page.passiveSlot.SetSlotCount(slotIndex, skillLevel)
                if skillPoint > 0:
                    if skillLevel < skillMaxLevel:
                        page.passiveSlot.ShowSlotButton(slotIndex)
            """

            ## Active
            for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):

                slotIndex = page.activeSlot.GetStartIndex()+i
                skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST
                skillLevel = guild.GetSkillLevel(slotIndex)
                skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)

                page.activeSlot.SetSlotCount(slotIndex, skillLevel)

                if skillLevel <= 0:
                    page.activeSlot.DisableCoverButton(slotIndex)
                else:
                    page.activeSlot.EnableCoverButton(slotIndex)

                if skillPoint > 0:
                    if skillLevel < skillMaxLevel:
                        page.activeSlot.ShowSlotButton(slotIndex)

        def RefreshGuildGradePage(self):

            if self.isLoaded==0:
                return

            page = self.pageWindow["GRADE"]

            for key, slotList in page.gradeDict.items():
                name, authority = guild.GetGradeData(int(key))

                slotList[self.GRADE_SLOT_NAME].SetText(name)
                slotList[self.GRADE_ADD_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_ADD_MEMBER)
                slotList[self.GRADE_REMOVE_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
                slotList[self.GRADE_NOTICE_AUTHORITY].SetCheck(authority & guild.AUTH_NOTICE)
                slotList[self.GRADE_SKILL_AUTHORITY].SetCheck(authority & guild.AUTH_SKILL)

        ## GuildInfo

        def __PopupMessage(self, msg):
            self.popupMessage.SetText(msg)
            self.popupDialog.SetTop()
            self.popupDialog.Show()

        def __OnClickSelectGuildMarkButton(self):
            if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL):
                self.__PopupMessage(localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL)
            elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
                self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION)
            else:
                self.markSelectDialog.Open()

        def __OnClickSelectGuildSymbolButton(self):
            if guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
                self.symbolSelectDialog.Open()
            else:
                self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION)

        def __OnClickDeclareWarButton(self):
            inputDialog = DeclareGuildWarDialog()
            inputDialog.Open()
            self.inputDialog = inputDialog

        def __OnSelectMark(self, markFileName):
            ret = net.UploadMark("upload/"+markFileName)

            # MARK_BUG_FIX
            if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret:
                self.__PopupMessage(localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT);

            return ret
            # END_OF_MARK_BUG_FIX

        def __OnSelectSymbol(self, symbolFileName):
            net.UploadSymbol("upload/"+symbolFileName)

        def __OnClickOfferButton(self):

            curEXP = unsigned32(player.GetStatus(player.EXP))

            if curEXP <= 100:
                self.__PopupMessage(localeInfo.GUILD_SHORT_EXP);
                return

            self.offerDialog.Open(curEXP, 100)

        def __OnClickDepositButton(self):
            moneyDialog = uiPickMoney2.PickMoneyDialog()
            moneyDialog.LoadDialog()
            moneyDialog.SetMax(6)
            moneyDialog.SetTitleName(localeInfo.GUILD_DEPOSIT)
            moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeposit))
            moneyDialog.Open(player.GetMoney())
            self.moneyDialog = moneyDialog

        def __OnClickWithdrawButton(self):
            moneyDialog = uiPickMoney2.PickMoneyDialog()
            moneyDialog.LoadDialog()
            moneyDialog.SetMax(6)
            moneyDialog.SetTitleName(localeInfo.GUILD_WITHDRAW)
            moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnWithdraw))
            moneyDialog.Open(guild.GetGuildMoney())
            self.moneyDialog = moneyDialog

        def __OnBlock(self):
            popup = uiCommon.PopupDialog()
            popup.SetText(localeInfo.NOT_YET_SUPPORT)
            popup.SetAcceptEvent(self.__OnClosePopupDialog)
            popup.Open()
            self.popup = popup

        def __OnClosePopupDialog(self):
            self.popup = None

        def OnDeposit(self, money):
            net.SendGuildDepositMoneyPacket(money)

        def OnWithdraw(self, money):
            net.SendGuildWithdrawMoneyPacket(money)

        def OnOffer(self, exp):
            net.SendGuildOfferPacket(exp)

        ## Board
        def OnPostComment(self):

            text = self.commentSlot.GetText()
            if not text:
                return False

            net.SendGuildPostCommentPacket(text[:50])
            self.commentSlot.SetText("")
            return True

        def OnDeleteComment(self, index):

            commentID, chrName, comment = self.__GetGuildBoardCommentData(index)
            net.SendGuildDeleteCommentPacket(commentID)

        def OnRefreshComments(self):
            net.SendGuildRefreshCommentsPacket(0)

        def OnKeyDownInBoardPage(self, key):
            if key == 63:
                self.OnRefreshComments()
            return True

        ## Member
        ## OnEnableGeneral
        def OnChangeMemberGrade(self, lineIndex, gradeNumber):
            PID = guild.MemberIndexToPID(lineIndex + self.memberLinePos)
            net.SendGuildChangeMemberGradePacket(PID, gradeNumber)

        def OnEnableGeneral(self, lineIndex):
            if not guild.IsMember(lineIndex):
                return

            pid, name, grade, job, level, offer, general = self.GetMemberData(lineIndex)
            if pid < 0:
                return

            net.SendGuildChangeMemberGeneralPacket(pid, 1 - general)

        ## Grade
        def OnOpenChangeGradeName(self, arg):
            self.changeGradeNameDialog.SetGradeNumber(arg)
            self.changeGradeNameDialog.Open()

        def OnChangeGradeName(self):
            self.changeGradeNameDialog.Hide()
            gradeNumber = self.changeGradeNameDialog.GetGradeNumber()
            gradeName = self.changeGradeNameDialog.GetGradeName()

            if len(gradeName) == 0:
                gradeName = localeInfo.GUILD_DEFAULT_GRADE

            net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName)
            return True

        def OnCheckAuthority(self, argIndex, argAuthority):
            name, authority = guild.GetGradeData(argIndex)
            net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority)

        def OnScrollMemberLine(self):
            scrollBar = self.pageWindow["MEMBER"].scrollBar
            pos = scrollBar.GetPos()

            count = guild.GetMemberCount()
            newLinePos = int(float(count - self.MEMBER_LINE_COUNT) * pos)

            if newLinePos != self.memberLinePos:
                self.memberLinePos = newLinePos
                self.RefreshGuildMemberPageMemberList()
                self.__CloseAllGuildMemberPageGradeComboBox()

        def GetMemberData(self, localPos):
            return guild.GetMemberData(localPos + self.memberLinePos)

        ## Guild Skill
        def __OnOpenHealGSPBoard(self):

            curPoint, maxPoint = guild.GetDragonPowerPoint()

            if maxPoint - curPoint <= 0:
                self.__PopupMessage(localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE)
                return

            pickDialog = uiPickMoney2.PickMoneyDialog()
            pickDialog.LoadDialog()
            pickDialog.SetMax(9)
            pickDialog.SetTitleName(localeInfo.GUILD_HEAL_GSP)
            pickDialog.SetAcceptEvent(ui.__mem_func__(self.__OnOpenHealGSPQuestionDialog))
            pickDialog.Open(maxPoint - curPoint, 1)
            self.pickDialog = pickDialog

        def __OnOpenHealGSPQuestionDialog(self, healGSP):

            money = healGSP * constInfo.GUILD_MONEY_PER_GSP

            questionDialog = uiCommon.QuestionDialog()
            questionDialog.SetText(localeInfo.GUILD_DO_YOU_HEAL_GSP % (money, healGSP))
            questionDialog.SetAcceptEvent(ui.__mem_func__(self.__OnHealGSP))
            questionDialog.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog))
            questionDialog.SetWidth(400)
            questionDialog.Open()
            questionDialog.healGSP = healGSP
            self.questionDialog = questionDialog

        def __OnHealGSP(self):
            net.SendGuildChargeGSPPacket(self.questionDialog.healGSP)
            self.__OnCloseQuestionDialog()

        def __OnCloseQuestionDialog(self):
            if self.questionDialog:
                self.questionDialog.Close()
            self.questionDialog = None

        def OnPickUpGuildSkill(self, skillSlotIndex, type):

            mouseController = mouseModule.mouseController

            if False == mouseController.isAttached():

                skillIndex = player.GetSkillIndex(skillSlotIndex)
                skillLevel = guild.GetSkillLevel(skillSlotIndex)

                if skill.CanUseSkill(skillIndex) and skillLevel > 0:

                    if app.IsPressed(app.DIK_LCONTROL):

                        player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, skillSlotIndex)
                        return

                    mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, skillSlotIndex, skillIndex)

            else:
                mouseController.DeattachObject()

        def OnUseGuildSkill(self, slotNumber, type):
            skillIndex = player.GetSkillIndex(slotNumber)
            skillLevel = guild.GetSkillLevel(slotNumber)

            if skillLevel <= 0:
                return

            player.UseGuildSkill(slotNumber)

        def OnUpGuildSkill(self, slotNumber, type):
            skillIndex = player.GetSkillIndex(slotNumber)
            net.SendChatPacket("/gskillup " + str(skillIndex))

        def OnUseSkill(self, slotNumber, coolTime):

            if self.isLoaded==0:
                return

            page = self.pageWindow["SKILL"]

            if page.activeSlot.HasSlot(slotNumber):
                page.activeSlot.SetSlotCoolTime(slotNumber, coolTime)

        def OnStartGuildWar(self, guildSelf, guildOpp):

            if self.isLoaded==0:
                return

            if guild.GetGuildID() != guildSelf:
                return

            guildName = guild.GetGuildName(guildOpp)
            for guildNameTextLine in self.enemyGuildNameList:
                if localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY == guildNameTextLine.GetText():
                    guildNameTextLine.SetText(guildName)
                    return

        def OnEndGuildWar(self, guildSelf, guildOpp):

            if self.isLoaded==0:
                return

            if guild.GetGuildID() != guildSelf:
                return

            guildName = guild.GetGuildName(guildOpp)
            for guildNameTextLine in self.enemyGuildNameList:
                if guildName == guildNameTextLine.GetText():
                    guildNameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY)
                    return

        ## ToolTip
        def OverInItem(self, slotNumber, type):

            if mouseModule.mouseController.isAttached():
                return

            if None != self.tooltipSkill:
                skillIndex = player.GetSkillIndex(slotNumber)
                skillLevel = guild.GetSkillLevel(slotNumber)

                self.tooltipSkill.SetSkill(skillIndex, skillLevel)

        def OverOutItem(self):
            if None != self.tooltipSkill:
                self.tooltipSkill.HideToolTip()

        def OnPressEscapeKey(self):
            self.Close()
            return True


    class BuildGuildBuildingWindow(ui.ScriptWindow):

        if localeInfo.IsJAPAN():
            GUILD_CATEGORY_LIST = (
                    ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER),
                    ("FACILITY",     localeInfo.GUILD_FACILITY),
                    ("OBJECT",     localeInfo.GUILD_OBJECT),
                )
        elif localeInfo.IsYMIR() or localeInfo.IsWE_KOREA():
            GUILD_CATEGORY_LIST = (
                    ("HEADQUARTER", "본건물"),
                    ("FACILITY", "기능건물"),
                    ("OBJECT", "조경물"),
                )
        elif localeInfo.IsEUROPE() or localeInfo.IsHONGKONG():
            GUILD_CATEGORY_LIST = (
                    ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER),
                    ("FACILITY",     localeInfo.GUILD_FACILITY),
                    ("OBJECT",     localeInfo.GUILD_OBJECT),
                )
        else:
            try :
                GUILD_CATEGORY_LIST = (
                        ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER),
                        ("FACILITY",     localeInfo.GUILD_FACILITY),
                        ("OBJECT",     localeInfo.GUILD_OBJECT),
                    )
            except:
                GUILD_CATEGORY_LIST = (
                        ("HEADQUARTER", "Main Building"),
                        ("FACILITY", "Facility"),
                        ("OBJECT", "Object"),
                    )

        MODE_VIEW = 0
        MODE_POSITIONING = 1
        MODE_PREVIEW = 2

        BUILDING_ALPHA = 0.55

        ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
        DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)

        START_INSTANCE_INDEX = 123450
        #WALL_SET_INSTANCE = 14105

        def __init__(self):
            ui.ScriptWindow.__init__(self)
            self.__LoadWindow()

            self.closeEvent = None
            self.popup = None
            self.mode = self.MODE_VIEW
            self.race = 0
            self.type = None
            self.x = 0
            self.y = 0
            self.z = 0
            self.rot_x = 0
            self.rot_y = 0
            self.rot_z = 0
            self.rot_x_limit = 0
            self.rot_y_limit = 0
            self.rot_z_limit = 0
            self.needMoney = 0
            self.needStoneCount = 0
            self.needLogCount = 0
            self.needPlywoodCount = 0

            #self.index = 0
            self.indexList = []
            self.raceList = []
            self.posList = []
            self.rotList = []

            index = 0
            for category in self.GUILD_CATEGORY_LIST:
                self.categoryList.InsertItem(index, category[1])
                index += 1

        def __del__(self):
            ui.ScriptWindow.__del__(self)

        def __LoadWindow(self):

            try:
                pyScrLoader = ui.PythonScriptLoader()
                if localeInfo.IsARABIC():
                    pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "buildguildbuildingwindow.py")
                elif localeInfo.IsVIETNAM():
                    pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "buildguildbuildingwindow.py")
                else:
                    pyScrLoader.LoadScriptFile(self, "uiscript/buildguildbuildingwindow.py")
            except:
                import exception
                exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript")

            try:
                getObject = self.GetChild
                self.board = getObject("Board")
                self.categoryList = getObject("CategoryList")
                self.buildingList = getObject("BuildingList")
                self.listScrollBar = getObject("ListScrollBar")
                self.positionButton = getObject("PositionButton")
                self.previewButton = getObject("PreviewButton")
                self.posValueX = getObject("BuildingPositionXValue")
                self.posValueY = getObject("BuildingPositionYValue")
                self.ctrlRotationX = getObject("BuildingRotationX")
                self.ctrlRotationY = getObject("BuildingRotationY")
                self.ctrlRotationZ = getObject("BuildingRotationZ")
                self.buildingPriceValue = getObject("BuildingPriceValue")
                self.buildingMaterialStoneValue = getObject("BuildingMaterialStoneValue")
                self.buildingMaterialLogValue = getObject("BuildingMaterialLogValue")
                self.buildingMaterialPlywoodValue = getObject("BuildingMaterialPlywoodValue")

                self.positionButton.SetEvent(ui.__mem_func__(self.__OnSelectPositioningMode))
                self.previewButton.SetToggleDownEvent(ui.__mem_func__(self.__OnEnterPreviewMode))
                self.previewButton.SetToggleUpEvent(ui.__mem_func__(self.__OnLeavePreviewMode))
                self.ctrlRotationX.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
                self.ctrlRotationY.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
                self.ctrlRotationZ.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
                self.listScrollBar.SetScrollEvent(ui.__mem_func__(self.__OnScrollBuildingList))

                getObject("CategoryList").SetEvent(ui.__mem_func__(self.__OnSelectCategory))
                getObject("BuildingList").SetEvent(ui.__mem_func__(self.__OnSelectBuilding))
                getObject("AcceptButton").SetEvent(ui.__mem_func__(self.Build))
                getObject("CancelButton").SetEvent(ui.__mem_func__(self.Close))
                self.board.SetCloseEvent(ui.__mem_func__(self.Close))

            except:
                import exception
                exception.Abort("BuildGuildBuildingWindow.__LoadWindow - BindObject")

        def __CreateWallBlock(self, race, x, y, rot=0.0 ):
            idx = self.START_INSTANCE_INDEX + len(self.indexList)
            self.indexList.append(idx)
            self.raceList.append(race)
            self.posList.append((x, y))
            self.rotList.append(rot)
            chr.CreateInstance(idx)
            chr.SelectInstance(idx)
            chr.SetVirtualID(idx)
            chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)

            chr.SetRace(race)
            chr.SetArmor(0)
            chr.Refresh()
            chr.SetLoopMotion(chr.MOTION_WAIT)
            chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)
            chr.SetRotationAll(0.0, 0.0, rot)

            self.ctrlRotationX.SetSliderPos(0.5)
            self.ctrlRotationY.SetSliderPos(0.5)
            self.ctrlRotationZ.SetSliderPos(0.5)

        def __GetObjectSize(self, race):
            idx = self.START_INSTANCE_INDEX + 1000
            chr.CreateInstance(idx)
            chr.SelectInstance(idx)
            chr.SetVirtualID(idx)
            chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)

            chr.SetRace(race)
            chr.SetArmor(0)
            chr.Refresh()
            chr.SetLoopMotion(chr.MOTION_WAIT)
            sx, sy, ex, ey = chr.GetBoundBoxOnlyXY(idx)
            chr.DeleteInstance(idx)
            return sx, sy, ex, ey

        def __GetBuildInPosition(self):

            zList = []
            zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.syPos) )
            zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.eyPos) )
            zList.append( background.GetHeight(self.x+self.exPos, self.y+self.syPos) )
            zList.append( background.GetHeight(self.x+self.exPos, self.y+self.eyPos) )
            zList.append( background.GetHeight(self.x+(self.exPos+self.sxPos)/2, self.y+(self.eyPos+self.syPos)/2) )
            zList.sort()
            return zList[3]

        def __CreateBuildInInstance(self,race):

            self.__DeleteInstance()

            object_base = race - race%10

            door_minX, door_minY, door_maxX, door_maxY = self.__GetObjectSize(object_base+4)
            corner_minX, corner_minY, corner_maxX, corner_maxY = self.__GetObjectSize(object_base+1)
            line_minX, line_minY, line_maxX, line_maxY = self.__GetObjectSize(object_base+2)
            line_width = line_maxX - line_minX
            line_width_half = line_width / 2

            X_SIZE_STEP = 2 * 2 ## 2의 단위로만 증가해야 함
            Y_SIZE_STEP = 8
            sxPos = door_maxX - corner_minX + (line_width_half*X_SIZE_STEP)
            exPos = -sxPos
            syPos = 0
            eyPos = -(corner_maxY*2 + line_width*Y_SIZE_STEP)

            self.sxPos = sxPos
            self.syPos = syPos
            self.exPos = exPos
            self.eyPos = eyPos

            z = self.__GetBuildInPosition()

            ## Door
            self.__CreateWallBlock(object_base+4, 0.0, syPos)

            ## Corner
            self.__CreateWallBlock(object_base+1, sxPos, syPos)
            self.__CreateWallBlock(object_base+1, exPos, syPos, 270.0)
            self.__CreateWallBlock(object_base+1, sxPos, eyPos, 90.0)
            self.__CreateWallBlock(object_base+1, exPos, eyPos,180.0 )

            ## Line
            lineBlock = object_base+2
            line_startX = -door_maxX - line_minX - (line_width_half*X_SIZE_STEP)
            self.__CreateWallBlock(lineBlock, line_startX, eyPos)
            self.__CreateWallBlock(lineBlock, line_startX+line_width*1, eyPos)
            self.__CreateWallBlock(lineBlock, line_startX+line_width*2, eyPos)
            self.__CreateWallBlock(lineBlock, line_startX+line_width*3, eyPos)
            for i in xrange(X_SIZE_STEP):
                self.__CreateWallBlock(lineBlock, line_startX+line_width*(3+i+1), eyPos)
            for i in xrange(X_SIZE_STEP/2):
                self.__CreateWallBlock(lineBlock, door_minX - line_maxX - line_width*i, syPos)
                self.__CreateWallBlock(lineBlock, door_maxX - line_minX + line_width*i, syPos)
            for i in xrange(Y_SIZE_STEP):
                self.__CreateWallBlock(lineBlock, sxPos, line_minX + corner_minX - line_width*i, 90.0)
                self.__CreateWallBlock(lineBlock, exPos, line_minX + corner_minX - line_width*i, 90.0)

            self.SetBuildingPosition(int(self.x), int(self.y), self.__GetBuildInPosition())

        def __DeleteInstance(self):
            if not self.indexList:
                return

            for index in self.indexList:
                chr.DeleteInstance(index)

            self.indexList = []
            self.raceList = []
            self.posList = []
            self.rotList = []

        def __CreateInstance(self, race):

            self.__DeleteInstance()

            self.race = race

            idx = self.START_INSTANCE_INDEX
            self.indexList.append(idx)
            self.posList.append((0, 0))
            self.rotList.append(0)

            chr.CreateInstance(idx)
            chr.SelectInstance(idx)
            chr.SetVirtualID(idx)
            chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)

            chr.SetRace(race)
            chr.SetArmor(0)
            chr.Refresh()
            chr.SetLoopMotion(chr.MOTION_WAIT)
            chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)

            self.SetBuildingPosition(int(self.x), int(self.y), 0)
            self.ctrlRotationX.SetSliderPos(0.5)
            self.ctrlRotationY.SetSliderPos(0.5)
            self.ctrlRotationZ.SetSliderPos(0.5)

        def Build(self):

            if not self.__IsEnoughMoney():
                self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MONEY)
                return
            if not self.__IsEnoughMaterialStone():
                self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
                return
            if not self.__IsEnoughMaterialLog():
                self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
                return
            if not self.__IsEnoughMaterialPlywood():
                self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
                return

            ## /build c vnum x y x_rot y_rot z_rot
            ## /build d vnum
            if "BUILDIN" == self.type:
                for i in xrange(len(self.raceList)):
                    race = self.raceList
                    xPos, yPos = self.posList
                    rot = self.rotList
                    net.SendChatPacket("/build c %d %d %d %d %d %d" % (race, int(self.x+xPos), int(self.y+yPos), self.rot_x, self.rot_y, rot))
            else:
                net.SendChatPacket("/build c %d %d %d %d %d %d" % (self.race, int(self.x), int(self.y), self.rot_x, self.rot_y, self.rot_z))

            self.Close()

        def Open(self):
            x, y, z = player.GetMainCharacterPosition()
            app.SetCameraSetting(int(x), int(-y), int(z), 3000, 0, 30)

            background.VisibleGuildArea()

            self.x = x
            self.y = y
            self.z = z
            self.categoryList.SelectItem(0)
            self.buildingList.SelectItem(0)
            self.SetTop()
            self.Show()
            self.__DisablePCBlocker()

            import debugInfo
            if debugInfo.IsDebugMode():
                self.categoryList.SelectItem(2)
                self.buildingList.SelectItem(0)

        def Close(self):

            self.__DeleteInstance()

            background.DisableGuildArea()

            self.Hide()
            self.__OnClosePopupDialog()
            self.__EnablePCBlocker()
            self.__UnlockCameraMoving()
            if self.closeEvent:
                self.closeEvent()

        def Destory(self):
            self.Close()

            self.ClearDictionary()
            self.board = None
            self.categoryList = None
            self.buildingList = None
            self.listScrollBar = None
            self.positionButton = None
            self.previewButton = None
            self.posValueX = None
            self.posValueY = None
            self.ctrlRotationX = None
            self.ctrlRotationY = None
            self.ctrlRotationZ = None
            self.buildingPriceValue = None
            self.buildingMaterialStoneValue = None
            self.buildingMaterialLogValue = None
            self.buildingMaterialPlywoodValue = None
            self.closeEvent = None

        def SetCloseEvent(self, event):
            self.closeEvent = event

        def __PopupDialog(self, text):
            popup = uiCommon.PopupDialog()
            popup.SetText(text)
            popup.SetAcceptEvent(self.__OnClosePopupDialog)
            popup.Open()
            self.popup = popup

        def __OnClosePopupDialog(self):
            self.popup = None

        def __EnablePCBlocker(self):
            ## PC Blocker 처리를 켠다. (투명해짐)
            chr.SetInstanceType(chr.INSTANCE_TYPE_BUILDING)

            for idx in self.indexList:
                chr.SetBlendRenderMode(idx, 1.0)

        def __DisablePCBlocker(self):
            ## PC Blocker 처리를 끈다. (안투명해짐)
            chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)

            for idx in self.indexList:
                chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)

        def __OnSelectPositioningMode(self):
            if self.MODE_PREVIEW == self.mode:
                self.positionButton.SetUp()
                return

            self.mode = self.MODE_POSITIONING
            self.Hide()

        def __OnEnterPreviewMode(self):

            if self.MODE_POSITIONING == self.mode:
                self.previewButton.SetUp()
                return

            self.mode = self.MODE_PREVIEW
            self.positionButton.SetUp()
            self.__UnlockCameraMoving()
            self.__EnablePCBlocker()

        def __OnLeavePreviewMode(self):
            self.__RestoreViewMode()

        def __RestoreViewMode(self):
            self.__DisablePCBlocker()
            self.__LockCameraMoving()
            self.mode = self.MODE_VIEW
            self.positionButton.SetUp()
            self.previewButton.SetUp()

        def __IsEnoughMoney(self):

            if app.IsEnableTestServerFlag():
                return True

            curMoney = player.GetMoney()
            if curMoney < self.needMoney:
                return False
            return True

        def __IsEnoughMaterialStone(self):

            if app.IsEnableTestServerFlag():
                return True

            curStoneCount = player.GetItemCountByVnum(MATERIAL_STONE_ID)
            if curStoneCount < self.needStoneCount:
                return False
            return True

        def __IsEnoughMaterialLog(self):

            if app.IsEnableTestServerFlag():
                return True

            curLogCount = player.GetItemCountByVnum(MATERIAL_LOG_ID)
            if curLogCount < self.needLogCount:
                return False
            return True

        def __IsEnoughMaterialPlywood(self):

            if app.IsEnableTestServerFlag():
                return True

            curPlywoodCount = player.GetItemCountByVnum(MATERIAL_PLYWOOD_ID)
            if curPlywoodCount < self.needPlywoodCount:
                return False
            return True

        def __OnSelectCategory(self):
            self.listScrollBar.SetPos(0.0)
            self.__RefreshItem()

        def __SetBuildingData(self, data):
            self.buildingPriceValue.SetText(NumberToMoneyString(data["PRICE"]))

            self.needMoney = int(data["PRICE"])

            materialList = data["MATERIAL"]
            self.needStoneCount = int(materialList[MATERIAL_STONE_INDEX])
            self.needLogCount = int(materialList[MATERIAL_LOG_INDEX])
            self.needPlywoodCount = int(materialList[MATERIAL_PLYWOOD_INDEX])

            if (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"):
                self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX])
                self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] )
                self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX])
            else:
                self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX] + localeInfo.THING_COUNT)
                self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] + localeInfo.THING_COUNT)
                self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX] + localeInfo.THING_COUNT)
            if self.__IsEnoughMoney():
                self.buildingPriceValue.SetPackedFontColor(self.ENABLE_COLOR)
            else:
                self.buildingPriceValue.SetPackedFontColor(self.DISABLE_COLOR)

            if self.__IsEnoughMaterialStone():
                self.buildingMaterialStoneValue.SetPackedFontColor(self.ENABLE_COLOR)
            else:
                self.buildingMaterialStoneValue.SetPackedFontColor(self.DISABLE_COLOR)

            if self.__IsEnoughMaterialLog():
                self.buildingMaterialLogValue.SetPackedFontColor(self.ENABLE_COLOR)
            else:
                self.buildingMaterialLogValue.SetPackedFontColor(self.DISABLE_COLOR)

            if self.__IsEnoughMaterialPlywood():
                self.buildingMaterialPlywoodValue.SetPackedFontColor(self.ENABLE_COLOR)
            else:
                self.buildingMaterialPlywoodValue.SetPackedFontColor(self.DISABLE_COLOR)

            self.rot_x_limit = data["X_ROT_LIMIT"]
            self.rot_y_limit = data["Y_ROT_LIMIT"]
            self.rot_z_limit = data["Z_ROT_LIMIT"]
            self.ctrlRotationX.Enable()
            self.ctrlRotationY.Enable()
            self.ctrlRotationZ.Enable()
            if 0 == self.rot_x_limit:
                self.ctrlRotationX.Disable()
            if 0 == self.rot_y_limit:
                self.ctrlRotationY.Disable()
            if 0 == self.rot_z_limit:
                self.ctrlRotationZ.Disable()

        def __OnSelectBuilding(self):
            buildingIndex = self.buildingList.GetSelectedItem()
            if buildingIndex >= len(BUILDING_DATA_LIST):
                return

            categoryIndex = self.categoryList.GetSelectedItem()
            if categoryIndex >= len(self.GUILD_CATEGORY_LIST):
                return
            selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0]

            index = 0
            for data in BUILDING_DATA_LIST:
                type = data["TYPE"]
                vnum = data["VNUM"]
                if selectedType != type:
                    continue

                if index == buildingIndex:
                    self.type = type
                    if "BUILDIN" == self.type:
                        self.__CreateBuildInInstance(vnum)
                    else:
                        self.__CreateInstance(vnum)

                    self.__SetBuildingData(data)

                index += 1

        def __OnScrollBuildingList(self):
            viewItemCount = self.buildingList.GetViewItemCount()
            itemCount = self.buildingList.GetItemCount()
            pos = self.listScrollBar.GetPos() * (itemCount-viewItemCount)
            self.buildingList.SetBasePos(int(pos))

        def __OnChangeRotation(self):
            self.rot_x = self.ctrlRotationX.GetSliderPos() * self.rot_x_limit - self.rot_x_limit/2
            self.rot_y = self.ctrlRotationY.GetSliderPos() * self.rot_y_limit - self.rot_y_limit/2
            self.rot_z = (self.ctrlRotationZ.GetSliderPos() * 360 + 180) % 360
            if "BUILDIN" == self.type:
                chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z)
            else:
                chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z)

        def __LockCameraMoving(self):
            app.SetCameraSetting(int(self.x), int(-self.y), int(self.z), 3000, 0, 30)

        def __UnlockCameraMoving(self):
            app.SetDefaultCamera()

        def __RefreshItem(self):

            self.buildingList.ClearItem()

            categoryIndex = self.categoryList.GetSelectedItem()
            if categoryIndex >= len(self.GUILD_CATEGORY_LIST):
                return
            selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0]

            index = 0
            for data in BUILDING_DATA_LIST:
                if selectedType != data["TYPE"]:
                    continue

                if data["SHOW"]:
                    self.buildingList.InsertItem(index, data["LOCAL_NAME"])

                index += 1

            self.buildingList.SelectItem(0)

            if self.buildingList.GetItemCount() < self.buildingList.GetViewItemCount():
                self.buildingList.SetSize(120, self.buildingList.GetHeight())
                self.buildingList.LocateItem()
                self.listScrollBar.Hide()
            else:
                self.buildingList.SetSize(105, self.buildingList.GetHeight())
                self.buildingList.LocateItem()
                self.listScrollBar.Show()

        def SettleCurrentPosition(self):
            guildID = miniMap.GetGuildAreaID(self.x, self.y)

            import debugInfo
            if debugInfo.IsDebugMode():
                guildID = player.GetGuildID()

            if guildID != player.GetGuildID():
                return

            self.__RestoreViewMode()
            self.__LockCameraMoving()
            self.Show()

        def SetBuildingPosition(self, x, y, z):
            self.x = x
            self.y = y
            self.posValueX.SetText(str(int(x)))
            self.posValueY.SetText(str(int(y)))

            for i in xrange(len(self.indexList)):
                idx = self.indexList
                xPos, yPos = self.posList

                chr.SelectInstance(idx)
                if 0 != z:
                    self.z = z
                    chr.SetPixelPosition(int(x+xPos), int(y+yPos), int(z))
                else:
                    chr.SetPixelPosition(int(x+xPos), int(y+yPos))

        def IsPositioningMode(self):
            if self.MODE_POSITIONING == self.mode:
                return True
            return False

        def IsPreviewMode(self):
            if self.MODE_PREVIEW == self.mode:
                return True
            return False

        def OnPressEscapeKey(self):
            self.Close()
            return True

    """
    - 프로토콜

    게임돌입시:
        RecvLandPacket:
            CPythonMiniMap::RegisterGuildArea

    게임이동중:
        PythonPlayer::Update()
            CPythonPlayer::__Update_NotifyGuildAreaEvent()
                game.py.BINARY_Guild_EnterGuildArea
                    uigameButton.GameButtonWindow.ShowBuildButton()
                game.py.BINARY_Guild_ExitGuildArea
                    uigameButton.GameButtonWindow.HideBuildButton()

    BuildButton:
    !길드장인지 처리 없음
    !건물이 있어도 짓기 버튼은 있음

    !건물이 임시로 사용하는 VID 는 서버가 보내주는 것과 혼동될 염려가 있음
    !건물 VNUM 은 BuildGuildBuildingWindow.BUILDING_VNUM_LIST 를 이용해 변환

    !건물 지을때는 /build c(reate)
    !건물 부술때는 /build d(estroy)
    !rotation 의 단위는 degree

        interfaceModule.interface.__OnClickBuildButton:
            interfaceModule.interface.BUILD_OpenWindow:

    AcceptButton:
        BuildGuildBuildingWindow.Build:
            net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot")

    PreviewButton:
        __OnPreviewMode:
        __RestoreViewMode:

    건물 부수기:
        uiTarget.TargetBoard.__OnDestroyBuilding
            net.SendChatPacket("/build d vid")
    """

    if __name__ == "__main__":

        import app
        import wndMgr
        import systemSetting
        import mouseModule
        import grp
        import ui

        #wndMgr.SetOutlineFlag(True)

        app.SetMouseHandler(mouseModule.mouseController)
        app.SetHairColorEnable(True)
        wndMgr.SetMouseHandler(mouseModule.mouseController)
        wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
        app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
        mouseModule.mouseController.Create()

        import chrmgr
        chrmgr.CreateRace(0)
        chrmgr.SelectRace(0)
        chrmgr.SetPathName("d:/ymir Work/pc/warrior/")
        chrmgr.LoadRaceData("warrior.msm")
        chrmgr.SetPathName("d:/ymir work/pc/warrior/general/")
        chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL)
        chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa")
        chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, "run.msa")

        def LoadGuildBuildingList(filename):
            handle = app.OpenTextFile(filename)
            count = app.GetTextFileLineCount(handle)
            for i in xrange(count):
                line = app.GetTextFileLine(handle, i)
                tokens = line.split("\t")

                TOKEN_VNUM = 0
                TOKEN_TYPE = 1
                TOKEN_NAME = 2
                TOKEN_LOCAL_NAME = 3
                NO_USE_TOKEN_SIZE_1 = 4
                NO_USE_TOKEN_SIZE_2 = 5
                NO_USE_TOKEN_SIZE_3 = 6
                NO_USE_TOKEN_SIZE_4 = 7
                TOKEN_X_ROT_LIMIT = 8
                TOKEN_Y_ROT_LIMIT = 9
                TOKEN_Z_ROT_LIMIT = 10
                TOKEN_PRICE = 11
                TOKEN_MATERIAL = 12
                TOKEN_NPC = 13
                TOKEN_GROUP = 14
                TOKEN_DEPEND_GROUP = 15
                TOKEN_ENABLE_FLAG = 16
                LIMIT_TOKEN_COUNT = 17

                if not tokens[TOKEN_VNUM].isdigit():
                    continue

                if not int(tokens[TOKEN_ENABLE_FLAG]):
                    continue

                if len(tokens) < LIMIT_TOKEN_COUNT:
                    import dbg
                    dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line))
                    continue

                ENABLE_FLAG_TYPE_NOT_USE = False
                ENABLE_FLAG_TYPE_USE = True
                ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2

                if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]):
                    continue

                vnum = int(tokens[TOKEN_VNUM])
                type = tokens[TOKEN_TYPE]
                name = tokens[TOKEN_NAME]
                localName = tokens[TOKEN_LOCAL_NAME]
                xRotLimit = int(tokens[TOKEN_X_ROT_LIMIT])
                yRotLimit = int(tokens[TOKEN_Y_ROT_LIMIT])
                zRotLimit = int(tokens[TOKEN_Z_ROT_LIMIT])
                price = tokens[TOKEN_PRICE]
                material = tokens[TOKEN_MATERIAL]

                folderName = ""
                if "HEADQUARTER" == type:
                    folderName = "headquarter"
                elif "FACILITY" == type:
                    folderName = "facility"
                elif "OBJECT" == type:
                    folderName = "object"
                ##"BuildIn" Is made by exist instance.

                materialList = ["0", "0", "0"]
                if material[0] == "\"":
                    material = material[1:]
                if material[-1] == "\"":
                    material = material[:-1]
                for one in material.split("/"):
                    data = one.split(",")
                    if 2 != len(data):
                        continue
                    itemID = int(data[0])
                    count = data[1]

                    if itemID == MATERIAL_STONE_ID:
                        materialList[MATERIAL_STONE_INDEX] = count
                    elif itemID == MATERIAL_LOG_ID:
                        materialList[MATERIAL_LOG_INDEX] = count
                    elif itemID == MATERIAL_PLYWOOD_ID:
                        materialList[MATERIAL_PLYWOOD_INDEX] = count

                import chrmgr
                chrmgr.RegisterRaceSrcName(name, folderName)
                chrmgr.RegisterRaceName(vnum, name)

                appendingData = { "VNUM":vnum,
                                  "TYPE":type,
                                  "NAME":name,
                                  "LOCAL_NAME":localName,
                                  "X_ROT_LIMIT":xRotLimit,
                                  "Y_ROT_LIMIT":yRotLimit,
                                  "Z_ROT_LIMIT":zRotLimit,
                                  "PRICE":price,
                                  "MATERIAL":materialList,
                                  "SHOW" : True }

                if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]):
                    appendingData["SHOW"] = False

                BUILDING_DATA_LIST.append(appendingData)

            app.CloseTextFile(handle)

        LoadGuildBuildingList(app.GetLocalePath()+"/GuildBuildingList.txt")

        class TestGame(ui.Window):
            def __init__(self):
                ui.Window.__init__(self)

                x = 30000
                y = 40000

                self.wndGuildBuilding = None
                self.onClickKeyDict = {}
                self.onClickKeyDict[app.DIK_SPACE] = lambda: self.OpenBuildGuildBuildingWindow()

                background.Initialize()
                background.LoadMap("metin2_map_a1", x, y, 0)
                background.SetShadowLevel(background.SHADOW_ALL)

                self.MakeCharacter(1, 0, x, y)
                player.SetMainCharacterIndex(1)
                chr.SelectInstance(1)

            def __del__(self):
                ui.Window.__del__(self)

            def MakeCharacter(self, index, race, x, y):
                chr.CreateInstance(index)
                chr.SelectInstance(index)
                chr.SetVirtualID(index)
                chr.SetInstanceType(chr.INSTANCE_TYPE_PLAYER)

                chr.SetRace(race)
                chr.SetArmor(0)
                chr.SetHair(0)
                chr.Refresh()
                chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
                chr.SetLoopMotion(chr.MOTION_WAIT)

                chr.SetPixelPosition(x, y)
                chr.SetDirection(chr.DIR_NORTH)

            def OpenBuildGuildBuildingWindow(self):
                self.wndGuildBuilding = BuildGuildBuildingWindow()
                self.wndGuildBuilding.Open()
                self.wndGuildBuilding.SetParent(self)
                self.wndGuildBuilding.SetTop()

            def OnKeyUp(self, key):
                if key in self.onClickKeyDict:
                    self.onClickKeyDict[key]()
                return True

            def OnMouseLeftButtonDown(self):
                if self.wndGuildBuilding:
                    if self.wndGuildBuilding.IsPositioningMode():
                        self.wndGuildBuilding.SettleCurrentPosition()
                        return

                player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
                return True

            def OnMouseLeftButtonUp(self):
                if self.wndGuildBuilding:
                    return

                player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
                return True

            def OnMouseRightButtonDown(self):
                player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS);
                return True

            def OnMouseRightButtonUp(self):
                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()
                if self.wndGuildBuilding:
                    if self.wndGuildBuilding.IsPositioningMode():
                        x, y, z = background.GetPickingPoint()
                        self.wndGuildBuilding.SetBuildingPosition(x, y, z)

            def OnRender(self):
                app.RenderGame()
                grp.PopState()
                grp.SetInterfaceRenderState()

        game = TestGame()
        game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
        game.Show()

        wndGuildBuilding = BuildGuildBuildingWindow()
        wndGuildBuilding.Open()
        wndGuildBuilding.SetTop()

        app.Loop()

        """
        - 프로토콜

    게임돌입시:
        RecvLandPacket:
            CPythonMiniMap::RegisterGuildArea

    게임이동중:
        PythonPlayer::Update()
            CPythonPlayer::__Update_NotifyGuildAreaEvent()
                game.py.BINARY_Guild_EnterGuildArea
                    uigameButton.GameButtonWindow.ShowBuildButton()
                game.py.BINARY_Guild_ExitGuildArea
                    uigameButton.GameButtonWindow.HideBuildButton()

    BuildButton:
    !길드장인지 처리 없음
    !건물이 있어도 짓기 버튼은 있음

    !건물이 임시로 사용하는 VID 는 서버가 보내주는 것과 혼동될 염려가 있음
    !건물 VNUM 은 BuildGuildBuildingWindow.BUILDING_VNUM_LIST 를 이용해 변환

    !건물 지을때는 /build c(reate)
    !건물 부술때는 /build d(estroy)
    !rotation 의 단위는 degree

        interfaceModule.interface.__OnClickBuildButton:
            interfaceModule.interface.BUILD_OpenWindow:

    AcceptButton:
        BuildGuildBuildingWindow.Build:
            net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot")

        x_rot, y_rot 는 AffectContainer에 저장

    PreviewButton:
        __OnPreviewMode:
        __RestoreViewMode:

    건물 부수기:
        uiTarget.TargetBoard.__OnDestroyBuilding
            net.SendChatPacket("/build d vid")
        """
     

    this is my GuildWindow class 

    onupdate function in inside class TestGame(ui.Window):  

    and i don't have another onupdate functions

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