Jump to content

Sandworks

Premium
  • Posts

    72
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    0%

Posts posted by Sandworks

  1. 18 hours ago, B7aR said:
      Hide contents
    
    
    
    quest serial_Mission begin
        state start begin
            when login or levelup with pc.get_level() >= 90 begin
                set_state("information")
            end
        end
        -- مهمه الأمين الأولي
        state information begin
            when letter begin
                local v = find_npc_by_vnum(9005)
                if v != 0 then
                    target.vid("warehouse", v, "warehouse")
                end
                
                send_letter(" ساعدالأمين ")
            end
            
            when button or info begin
                say_event_title(mob_name(11004))
                say("")
                say_gold(" مرحبا بك ".. pc.get_name() .." ")
    			say("")
                say_light_blue(" بلغني من امين المستودع أنه يبحث عنك لأمر هام ")
                say_light_blue(" أذهب من فضلك وتفقد ما الأمر الهام الذي يرغب به. ")
    	    say("")
            end
            
            when warehouse.target.click begin
                target.delete("warehouse")
                
                say_event_title(mob_name(9005))
                say("")
                say_gold(" مرحبا ".. pc.get_name() .."  ")
                say_light_blue(" وآخيرا قد أتيت . أبحث عنك منذ فترة ")
                say_light_blue(" كادت مواردي لصناعه الذهب أن تنفذ ")
                say_light_blue(" ولا أرغب في أن أتسبب في أزمه ماليه للاعبين ")
                say_light_blue(" أرغب في مساعدتك للحصول علي بعض الخامات ")
                say_light_blue(" يمكنك أن تجدهم لدي "..mob_name(9003).." ")
                say("")
    			
    				wait()
    				
    				say_event_title(mob_name(9005))
    				say("")
    				say_gold(" رجاء أخبرها بأنني أرغب في 200 قطعه من ")
    				say_item_vnum("71043")	
    				say("")	
    				say_light_blue(" أسرع وتحدث أليها.. ")
    				say("")
    				
    				set_state("go_to_Merchant")
            end
        end
        -- مهمه التاجره #2
        state go_to_Merchant begin
            when letter begin
                local v = find_npc_by_vnum(9003)
                if v != 0 then
                    target.vid("etc_shop", v, "etc_shop")
                end
                
                send_letter(" أذهب للتاجرة ")
            end
            
            when button or info begin
                say_event_title(" ساعد الأمين  ")
                say("")
    			say_light_blue(" أسرع وأذهب إلي "..mob_name(9003).."  ")
                say_light_blue(" لتحضر موارد الامين .. ")
    			say_light_blue(" لتحضر موارد الامين .. ")
    			say_light_blue(" أسرع ياهذا لاتكن  كسولاً ! ")
                say("")
            end
            
            when etc_shop.target.click begin
                target.delete("etc_shop")
                
                say_event_title(mob_name(9003))
                say("")
    			say_gold(" مرحبا ".. pc.get_name() .."   ")
    			say("")
                say_light_blue(" لقد أخبرني "..mob_name(9005).." بقدومك . ")
    			say_light_blue(" للأسف إن طلبك لايتوفر بكثره تلك الايام ")
    			say_light_blue(" ولتحصل عليه يلزمك تصريح من الزعيم ")
    			say_light_blue(" الأمر الجيد , التصريح متوفر")
    			say_light_blue(" الأمر السيء , لايمكنني الذهاب للزعيم حاليا")
                say_light_blue(" ولكن لدي الحل المناسب لهذا الأمر ")
    			say("")		
    			wait()
    			say_event_title(mob_name(9003))
    			say("")
                say_light_blue(" يمكنني أعطائك التصريح لتذهب به للزعيم مقابل خدمة بسيطة ")
                say_light_blue(" قام خُدام بيران بالهجوم علي إحدي قوافلي التجارية ")
    			say_light_blue(" يمكنك أن تثأر لي وتساعدني في الانتقام ")
                say_light_blue(" ساعدني في ردعهم وتدمير زعيمهم "..mob_name(2493).." ")
    			say_light_blue(" عبر قتله خمس مرات ، بداخل قلعته ")
                say_light_blue(" و سأعطيك التصريح لتسهيل الامور  عليك .")
                say_light_blue(" كهدية بسيطة نظير مجهوداتك في تخليصي من مشكلتي ")
    			say("")
                say_red(" لازلت هنا ! .. أسرع حتي لا تتأخر علي الأمين . ")
                say("")
    			
    			set_state("kill_biran")
            end
        end
    
        state kill_biran begin
            when letter begin
                send_letter(" أنتقم من بيران ")
            end
    		
            when button or info begin
    			say_event_title(" ساعد التاجرة ")
    			say("")
                say_reward(" قم بالهجوم علي الزعيم "..mob_name(2493).."  ")
                say_reward(" داخل قلعته لتثأر لـ "..mob_name(9003).."")
    			say("")
            end
     
            when 2493.kill begin
    		
                local bear1 = pc.getqf("kill_biran") + 1
    
                if bear1 <= 5 then
                    pc.setqf("kill_biran", bear1)
                    q.set_counter(" يجب عليك قتل " ,5)
    
                    if bear1 == 5 then
    				    say_event_title(mob_name(9003))
    					say("")
    					say_gold(" أحسنت ".. pc.get_name() .." ")
    					say("")
                        say_light_blue(" لقد قمت بسحق "..mob_name(9003).." الأن يمككني أن أشفي غليلي ")
    					say_light_blue(" أليك تصريح التجارة أذهب به للزعيم ")
    					say_light_blue(" وسيسمح لك بالحصول علي مرادك لمساعده الأمين ")
    					say_item_vnum(" 70610 ")
    					say_light_blue(" أسرع لمساعدته ")
    					pc.give_item2(71043, 1)
                        say(" ")
                    end
                end
    			clear_letter()
                set_state(__COMLETE__)
    		end	
        end
    	-- مهمه الزعيم #3
        state __COMLETE__ begin
            when letter begin
                local v = find_npc_by_vnum(20355)
                if v != 0 then
                    target.vid("captin", v, "captin")
                end
                
                send_letter(" أذهب للزعيم ")
            end
            
            when button or info begin
                say_event_title(" أذهب للزعيم ")
                say("")
                say_light_blue(" أسرع وأذهب للزعيم ليختم لك التصريح ")
                say_light_blue(" حينها يمكنك العوده للأمين مع الخامات  ")
    			say_light_blue(" أتبع النقطة المضيئة علي الخريطة   ")
                say_light_blue(" سترشدك ألية بسهوله ..  ")
                say("")
            end
            
            when captin.target.click begin
                target.delete("captin")
                
                say_event_title(mob_name(20355))
                say("")
                say_gold(" ها أنت ذا يا ".. pc.get_name() .." ")
                say_gold(" مممم , ترغب إذا في ختم تصريحك  ")
                say_gold(" حسنا أذا ")
    			
    			if pc.count_item(71043) < 1 then
    			    say("")
    				say_red(" أين التصريح ؟ اتحاول خداعي ياهذا ! ")
    				say_light_blue(" قم بأحضار ")
    				say_item_vnum(" 71043 ")
    				say_light_blue(" وحينها يمكنني مساعدتك ")
    			else
    				say_light_blue(" ولكن أولا عليك أتمام أمرا ما ")
    				say("")
    				say_light_blue(" كان من المفترض أن يصلني تقرير الصناعه من تاجر الاسلحه بالأمس ")
    				say_light_blue(" ولكن يبدوا انه لديه مشكله ما تعيقه عن الامر ")
    				wait()
    				say_title(mob_name(20355))
    				say("")
    				say_gold(" قم بتفقده وأحضر لي التقرير ")
    				say_gold(" وعوضا عن ذلك سأختم لك التصريح , وأجعل أحد المنقبين ")
    				say_gold(" يحضر لك الخامات الي هنا , وسأسلمها لك بنفسي بعد احضارك التقرير ")
    				say("")
    				say_red(" أسرع ايها الجندي , لما لاتزال واقفا أمامي ! ")
    				pc.remove_item(71043,1)
    				set_state(__COMLEETE__)
    			end
            end
        end
    	-- مهمه تاجر الاسلحة#4
    	state __COMLEETE__ begin
            when letter begin
                local v = find_npc_by_vnum(9001)
                if v != 0 then
                    target.vid("wepon", v, "wepon")
                end
                
                send_letter(" تفقد تاجر الاسلحة ")
            end
            
            when button or info begin
                say_event_title(mob_name(9001))
                say("")
                say_light_blue(" أحضر التقرير من تاجر الاسلحة ")
    			say_light_blue(" وأذهب به مسرعا للزعيم ")
    			say_light_blue(" لتتسلم خامات الأمين  ")
                say("")
            end
            
            when wepon.target.click begin
                target.delete("wepon")
                
                say_title(mob_name(9001))
                say("")
                say_gold(" يا ألهي هل أرسلك الزعيم ؟؟ ")
    			say("")
                say_light_blue(" أنا حقا في مشكلة عويصه أرجوك قم بمساعدتي.. ")
                say("")
    			say_light_blue(" كان من المفترض أرسال التقرير للزعيم بالأمس  ")
    			say_light_blue(" ولكن نقص تركيبتي الصناعيه يصيبني بالجنون ")
    			say_light_blue(" بالطبع انها  تستدعي الجنون يافتي !! ")
    			say_light_blue(" هي تركيبه مساعده أخلطها بمعادني الصناعيه ")
    			say_light_blue(" وكيف تفسر قوه أسلحتي وصلابتها أذا ! أتخال كل هذا ببساطه ! ")
    			say("")
    			wait()
    			say_event_title(mob_name(9001))
    			say("")
    				
    			say_gold(" أسمع ".. pc.get_name() .."   ")
    			say("")
    			say_light_blue(" لقد أرسلك القدير لمساعدتي ")
    			say_light_blue(" لن أدعك ترحل الا بمساعدتي ")
    			say_light_blue(" يمكنني مكافأتك بسخاء علي هذا الأمر ")
    			say_light_blue(" لن يستغرق الأمر منك سوي بعض الوقت ")
    			say_light_blue(" وستعود للزعيم بالتقرير ورساله أعتذار توضح له كل شئ ")
    			say_light_blue(" أحضر لي تركيبتي السحرية من "..mob_name(20018).." ")
    			say_gold(" وسأكافئك بـ ")
    			say_item_vnum("71144")
    			say("")	
    			set_state(__buik__)
            end
        end
    	-- مهمه بايك غو #5
    	state __buik__ begin
    	    when letter begin
                local v = find_npc_by_vnum(20018)
                if v != 0 then
                    target.vid("buik", v, "buik")
                end
                
                send_letter(" تفقد بايك-غو ")
            end
            
            when button or info begin
                say_event_title(mob_name(9001))
                say("")
                say_gold(" أسرع وتوجه لـ "..mob_name(20018).." ")
    			say("")
    			say_light_blue(" لتحضر التركيبة لتاجر الأسلحه ")
    			say_light_blue(" أتبع النقطة المضيئة علي الخريطة ")
                say_light_blue(" سترشدك ألية بسهوله ..  ")
    			say("")
    
            end
            
            when buik.target.click begin
                target.delete("buik")
                
                say_title(mob_name(9001))
    			say_gold(" مرحبا ".. pc.get_name() .."   ")
    			say("")
    			say_light_blue(" هل أرسلك "..mob_name(9001).." لتتسلم تركيبته ؟ ")
    			say_light_blue(" حسنا , من الجيد أنه ارسلك فتلك التركيبه  ")
                say_light_blue(" تتطلب بعض المساعده لأتمامها , اتمني انك لاتمانع هذا ")
    			say("")
    			say_yellow(" أليك قائمه ببعض الطلبات التي أرغب بها ")
    			say_yellow(" رجاء دونها جيدا حتي لاتنسي أحداها ")
    			say_yellow(" الدقه هي أهم امر في عالم التركيبات  ")
    			say_reward(" وحتما لاترغب في أن نهدر وقتا في اعاده صنعها إن اخطئنا ")
    			say("")
    			wait()
    			say_title(mob_name(20018))
    			say("")
    			say_green(" قم بأحضار شراب زهره الخوخ+ ")
    			say_item_vnum("76033")
    			say_green(" أرغب أيضا في بعض بذور الفطر ")
    			say_item_vnum("31086")
    			say_green(" وقليلا من شراب خولنجان ")
    			say_item_vnum("50216")
    			say("")
    			wait()
    			say_event_title(mob_name(20018))
    			say("")
    			say_light_blue(" يمكنك ان تجد تلك الادوات لدي صديقي ")
    			say_light_blue(mob_name(20084))
    			say("")
    			say_reward(" أسرع  ياصديقي , لا نرغب في التأخير ")
    			say("")
    			set_state(__biology__)
            end
        end
    	
    	-- مهمه شايغراب #6
    	
    	state __biology__ begin
    	    when letter begin
                local p = find_npc_by_vnum(20084)
                if p != 0 then
                    target.vid("biology", p, "biology")
    			end
                send_letter(" ادوات التركيبة ")
            end
    		
            when button or info begin
    		
    			say_event_title(mob_name(20018))
    			say("")
    			say_light_blue(" أسرع وأذهب لشايغراب البيولوجي ")
    			say_light_blue(" لتحضر ادوات التركيبة ")
    			say_light_blue(" فقط أتبع النقطه المضيئة علي الخريطة ")
    			say_light_blue(" سترشدك أليه بسهوله .. ")
    			say("")
    		end
    		when biology.target.click begin
                target.delete("biology")
                
                say_event_title(mob_name(20084))
    			say_gold(" مرحبا ".. pc.get_name() .."   ")
    			say("")
    			say_light_blue(" لقد أخبرني صديقي "..mob_name(20018).." بأرسالك ")
    			say_light_blue(" يمكنني توفير  متطلباتك نظير مساعدة بسيطة ")
                say_light_blue(" تقوم وحوش "..mob_name(391).." بمهاجمتي كثيرا تلك الايام ")
    			say_light_blue(" حسنا ربما أن من قام بأستفزازهم قليلا ,  ")
    			say_light_blue(" ولكنه أمر ضروري لأجراء بعض التجارب  ")
    			say("")
    			wait()
    			say_event_title(mob_name(20084))
    			say("")
    			say_reward(" ساعدني في التخلص  من "..mob_name(391).." ")
    			say("")
    			say_gold(" عبر قتلهم 30 مرة  ")
    			say_light_blue(" وسأكافئك بمتطلبات "..mob_name(20018).." ")
    			say(" أضافه الي مكافئتك ")
    			say(" أليست متطلباته ")
    			say_item_vnum("76033")
    			say_item_vnum("31086")
    			say_item_vnum("50216")
    			say("")	
    			wait()
    			say_event_title(mob_name(20084))
    			say("")
    			say_light_blue(" حسنا سأجهزها لك في الحال ")
    			say_reward(" بينما  تنهي  امر "..mob_name(391).." ")
    			say("")		
    			set_state(__kill_mob__)
            end
        end
          
       state __kill_mob__ begin
            when letter begin
                send_letter(" ساعد شايغراب ")
            end
    		
            when button or info begin
    			say_event_title(" ساعد شايغراب ")
    			say("")
                say_light_blue(" قم بمساعده شيغراب في التخلص  من "..mob_name(391).."  ")
                say_light_blue(" ليتسني له مساعدتك ومساعده "..mob_name(20018).." ")
    			say_light_blue(" يمكنك أن تجد "..mob_name(391).." هائمين في المدن الأولي ")
    			say("")
            end
     
            when 391.kill begin
    		
                local bear2 = pc.getqf("kill_mob") + 1
    
                if bear2 <= 30 then
                    pc.setqf("kill_mob", bear2)
                    q.set_counter(" يجب عليك قتل " ,30)
    
                    if bear2 == 30 then
    				    say_title(mob_name(20084))
    					say("")
    					say_gold(" أحسنت ".. pc.get_name() .." ")
    					say("")
                        say_light_blue(" لقد قمت بسحق "..mob_name(391).."30 مرة ")
    					say_reward(" أليك جائزتك التكريمية علي هذا الأمر ")
    					say_item_vnum("50218")
    					say_gold(" وأليك متطلبات "..mob_name(20018).." أسرع بالذهاب ألية ")
    					say_item_vnum("76033")
    					say_item_vnum("31086")
    					say_item_vnum("50216")
    					say("")
    					pc.give_item2(76033, 1)
    					pc.give_item2(31086, 1)
    					pc.give_item2(31086, 1)
    					set_state(__COMLEEETE__)
    				end
    			end
    		end
    	end	
    -- العوده لبايك غو
    	state __COMLEEETE__ begin
            when letter begin
                local v = find_npc_by_vnum(20018)
                if v != 0 then
                    target.vid("guo", v, "guo")
                end
                
                send_letter(" بايك-غو ")
            end
            
            when button or info begin
                say_event_title(mob_name(20018))
                say("")
                say_light_blue(" أحسنت يافتي  لقد أحضرت المتطلبات ")
    			say_light_blue(" أسرع في العوده لا نرغب في التأخر أكثر  ")
                say("")
            end
            
            when guo.target.click begin
                target.delete("guo")
                
                say_event_title(mob_name(20018))
                say("")
    			
    			if pc.count_item(76033)and(31086)and(50216) < 1 then
    			    say("")
    				say_light_blue(" أين المتطلبات !!  ")
    				say_light_blue(" كيف سأقوم بتحضير التركيبة بدون متطلبات !! ")
    				say_light_blue(" لا زال ينقصك ")
    				say_item_vnum("76033")
    				say_item_vnum("31086")
    				say_item_vnum("50216")
    			else
    				say_gold(" أحسنت ".. pc.get_name() .."   ")
    				say("")
    				say_light_blue(" تلك هيا المتطلبات التي أرغب فيها تحديدا ")
    				say_light_blue(" الأن أبتعد قليلا كي أقوم بالمزج ")
    				say_light_blue(" وتحضير التركيبة أليك ..  ")
    				say_light_blue(" قم بتجهيز القارورة التي ستحتويها ")
    				say_light_blue(" ماذا !! لم تحض قاروره !!  ")
    				say_light_blue(" أي شخص هذا الذي يرغب في تركيبه ولم يحضر قارورتها !! ")
    				say("")
    				wait()
    				say_event_title(mob_name(20018))
    				say("")
    				say_light_blue(" حسنا حسنا ".. pc.get_name() .."   ")
    				say_light_blue(" لا داعي لتعكر صفو مزاجي الأن .. ")
    				say_reward(" أذهب لـ "..mob_name(20011).." ")
    				say_light_blue(" أحضر منه قارورة فارغه ")
    				say_gold(" أنها تشبه تلك ")
    				say_item_vnum("50901")
    				say_red(" ولاتدعه ينصب عليك فأنه بارع في هذا ")
    				say("")	
    				pc.remove_item(76033, 1)
    				pc.remove_item(31086, 1)
    				pc.remove_item(50216, 1)
    				set_state(__uonah__)
    			end	
            end
        end
    
    -- إحضار القارورة
    	state __uonah__ begin
            when letter begin
                local v = find_npc_by_vnum(20011)
                if v != 0 then
                    target.vid("uonah", v, "uonah")
                end
                
                send_letter(" أحضر القارورة ")
            end
            
            when button or info begin
                say_event_title(mob_name(20018))
                say("")
                say_light_blue(" أسرع وأذهب لـ "..mob_name(20011).." ")
    			say_light_blue(" أوشكت علي الأنتهاء من التركيبة ")
    			say_light_blue(" وأرغب في القارورة لملئها أسرع ياهذا ")
    			say_light_blue(" إن لم تستنتج مكان يوناه من رأحته الكريهه ")
    			say_light_blue(" حينها عليك أتباع النقطه المضيئة علي الخريطة أولا ")
    			say_light_blue(" ثم البحث عن طبيب  لأنفك المعطل .. ")
                say("")
            end
            
            when uonah.target.click begin
                target.delete("uonah")
                
                say_title(mob_name(20011))
                say("")
                say_gold(" مرحبا ".. pc.get_name() .."   ")
    			say("")
                say_light_blue(" هل ترغب في قارورة ؟ ")
                say("")
    			say_light_blue(" مممم , يتوفر لدي العديد من القوراير المزينة  ")
    			say_light_blue(" يمكنني تدبير أحداهم لك مقابل سعر زهيد ")
    			say("")
    			say_reward(" لايتطلب الامر سوي كتلة ذهب  ")
    			say_item_vnum("80008")
    			
    			local con = select(" نعم ", " لا ")
    				if con == 1 then
    					say("")
    					if pc.count_item(80008) < 1 then
    						say("")
    						say_red(" للأسف صديقي لاتمتلك السعر المطلوب :( ")
    						say_red(" قم بالتجارة قليلا لحين تدبير المبلغ وعد إلي ")
    						say("")
    					else
    						say_gold(" حسنا أذا تفضل  قارورتك ")
    						say_item_vnum("50901")
    						pc.give_item2(50901, 1)
    						pc.remove_item(80008, 1)
    						say("")
    			            set_state("__buik_back__")
    					end	
    				elseif con == 2 then
    				    say_gold(" حسنا , ربما تغير رأيك لاحقا .. ")
    				end
    			end	
            end
        end
    
    -- العوده بالقارورة لبايك غو
    	state __buik_back__ begin
            when letter begin
                local v = find_npc_by_vnum(20018)
                if v != 0 then
                    target.vid("buik_back", v, "buik_back")
                end
                
                send_letter(" بايك -غو ")
            end
            
            when button or info begin
                say_event_title(mob_name(20018))
                say("")
                say_light_blue(" أحسنت تلك هيا القارورة المطلوبة ")
    			say_light_blue(" أسرع بالعودة لقد أنتهيت ولا أجد مايحتوي التركيبة ")
    			say_light_blue(" أنتظرك , لاتتأخر  ")
                say("")
            end
            
            when buik_back.target.click begin
                target.delete("buik_back")
                
                say_title(mob_name(20018))
                say("")
    			if pc.count_item(50901) < 1 then
    				say("")
    				say_red(" أتمازجني ".. pc.get_name() .." ! أين القارورة ياهذا ! ")
    				say_light_blue(" أسرع ايها المستهتر وأحضر قارورتي ")
    				say("")
    			else			
    				say_gold(" أحسنت ".. pc.get_name() .." ")
    				say("")
    				say_light_blue(" الأن يمكنني  أتمام الامر , فقط أنتظر قليلا ")
    				say("")
    				wait()
    				say_event_title(mob_name(20018))
    				say("")
    				say_reward(" أليك التركيبة السحرية لـ "..mob_name(9001).." ")
    				say_item_vnum("30197")
    				pc.give_item2(30197, 1)
    				pc.remove_item(50901, 1)
    				say_light_blue(" الأن أسرع بالعوده لـ "..mob_name(9001).." ")
    				say("")
    				set_state(__wepon_back__)
    			end	
            end
        end
    -- العوده لتاجر الاسلحة
    	state __wepon_back__ begin
            when letter begin
                local v = find_npc_by_vnum(9001)
                if v != 0 then
                    target.vid("wepon_back", v, "wepon_back")
                end
                
                send_letter(" تسليم التركيبة ")
            end
            
            when button or info begin
                say_event_title(" تسليم التركيبة  ")
                say("")
                say_light_blue(" أسرع بالعودة إلي تاجر الاسلحة ")
    			say_light_blue(" وقم بتسليمة التركيبة ")
    			say_light_blue(" لتتسلم التقرير وجائزتك  ")
                say("")
            end
            
            when wepon_back.target.click begin
                target.delete("wepon_back")
                
                say_event_title(mob_name(9001))
                say("")
                say_light_blue(" حمداً لله وأخيرا .. ")
    			say("")
                say_gold(" أشكرك بشدة ".. pc.get_name() .." ")
                say("")
    			say_reward(" أليك جائزتك كما وعدتك ")
    			say_item_vnum("71144")
    			say_reward(" وأليك أيضا تقرير الزعيم ")
    			say_item_vnum("21942")
    
    
    			say("")
    			
    			wait()
    			say_event_title(mob_name(9001))
    			say("")
    			say_gold(" الأن ".. pc.get_name() .."   ")
    			say("")
    			say_light_blue(" أسرع بالعودة للزعيم قبل أن يثور غاضبا علينا ")
    			say_light_blue(" ولا  تنسي أن توصل له أعتذاري عن التأخر  ")
    			say_light_blue(" وأخبره بأذن الامر كان خارجا عن مقدرتي .. ")
    			say("")	
    			pc.give_item2(71144, 1)
    			pc.give_item2(21942, 1)
    			pc.remove_item(30197, 1)
    			
    			set_state(__captin_back__)
            end
        end
    -- تسليم التقرير للزعيم
    	state __captin_back__ begin
            when letter begin
                local v = find_npc_by_vnum(20355)
                if v != 0 then
                    target.vid("captin_back", v, "captin_back")
                end
                
                send_letter(" سلم التقرير ")
            end
            
            when button or info begin
                say_event_title(mob_name(20355))
                say("")
                say_red(" ما الذي أخرك كل هذا أيها الجندي . ")
    			say_red(" أرسلتك لتحضر التقرير لا للتسكع  ")
    			say_red(" أسرع بالعودة بأقصي سرعتك .. ")
                say("")
            end
            
            when captin_back.target.click begin
                target.delete("captin_back")
                
                say_event_title(mob_name(20355))
                say("")
                say_light_blue(" هذا التقرير أذا  ")
                say_light_blue(" ممممم ,  يبدو كل شئ علي مايرام ")
    			say_reward(" حسنا أذا , اليك طلبك للأمين  ")
    			say_item_vnum("71043")
    			say("")
    			
    			wait()
    			say_title(mob_name(20355))
    			say("")
    				
    			say_light_blue(" الأن يمكنك الأنصراف ".. pc.get_name() .."   ")
    			say_light_blue(" ولكن كن علي مقربة  قد أحتاجك في مهمه أخري ")
    			say("")	
    			pc.give_item2(71043, 200)
    			pc.remove_item(21942, 1)
    			
    			set_state(__Amin_back__)
            end
        end
    	
    	-- تسليم الأمين
    	
    	state __Amin_back__ begin
            when letter begin
                local v = find_npc_by_vnum(9005)
                if v != 0 then
                    target.vid("Amin_back", v, "Amin_back")
                end
                
                send_letter(" تسليم الخامات ")
            end
            
            when button or info begin
                say_event_title(mob_name(9005))
                say("")
                say_gold(" صديقي ".. pc.get_name() .."   ")
    			say("")
    			say_light_blue(" لن أنسي لك هذا الجميل  ")
    			say_light_blue(" سمعت عن متاعبك خلال رحلتك ")
    			say_light_blue(" سأعوضك عن كل هذا فور عودتك ")
    			say_light_blue(" أنا في أنتظارك .. ")
                say("")
            end
            
            when Amin_back.target.click begin
                target.delete("Amin_back")
                
                say_event_title(mob_name(9005))
                say("")
                say_gold("  ".. pc.get_name() .." مرحبا بعودتك أيها البطل  ")
    			say("")
                say_light_blue(" يبدو أنه واجهتك العديد من المتاعب خلال الرحله ")
    			say_light_blue(" لكني لم أشك وهله في قدرتك علي تخطيها ")
    			if pc.count_item(71043) < 200 then
    				say_title(mob_name(9005))
    				say("")
    				say_red(" ولكن أين المتطلبات ؟ لما لم تحضرها معك ؟ ")
    				say_gold(" مر علي مجددا بعد أحضارها لتتسلم جائزتك . ")
    				say_gold(" أنها مئتان حبه من ")
    				say_item_vnum("71043")
    				say_light_blue(" لازلت تذكر أليس كذلك ؟ ")
    				say("")
    			else
    				say_title(mob_name(9005))
    				say("")
    				say_gold(" أشرك بشده علي أحضار طلبي ".. pc.get_name() .."   ")
    				say_reward(" أليك جائزتك علي هذا المجهود ")
    				say_item_vnum("53279")
    				say_gold(" وهذا تعويضا عن العقبات الاضافيه التي واجهتك ")
    				say_item_vnum("80008")
    				say("")	
    				pc.give_item2(53279, 1)
    				pc.give_item2(80008, 1)
    				pc.remove_item(71043, 200)
    			 	notice_all(" ".. pc.get_name() .."  تهنينا لك يابطل لقد أنهيت مساعدة الأمين بنجاح ..  ")				
    				clear_letter()
    				set_state(__COMLEEEEEETE__)
    				end	
    			end
    		end
    	end
    	
    	state __COMLEEEEEETE__ begin
    	
    	end  
    end  

     

     

    last edit but still the same problem :(

     

    Each "when" statement has to be closed with just one "end". The same applies to "state", "if" and "quest". As an example that I can see in your code, you are trying to close single "when" statement with four "end"ings. That will not work. Try to refactor your quest once again with the knowledge you now have.

  2. 3 hours ago, Gurgarath said:

    I don't know if it's intentional or not but I think the slider behaves in a weird way (a bit like old config.exe sliders).

     

    Once you start to slide it with the mouse, it will always go from a number directly to another, and those are not "round" numbers as you could expect them to be. Which is kind of frustrating because you are (unless I missed a feature) forced to use the mouse wheel or the arrows to increase / decrease by 0.010 until you find the perfect height.

     

    For example with Height base : It will always follow this pattern

    083935Screenshot-10.png

     

    0.320, 0.950, 1.580, 2.210 and so on.

     

    I think it would be easier to advance the slider in increments of 0.500 and to be able to decrease / increase by 0.100 by using shift + left/right arrows.

     

    Keep up the good work! ?️

    Just hold 4 or 5 ($ or %) and scroll the mousewheel, man. It makes no sense to move your cursor outside of the canvas while holding an object. I got what you mean but there's no more efficient way. The keys do the exact same thing that you wrote above except the fact the values are 1.0 & 0.050.

    • Love 1
  3. 8 hours ago, martysama0134 said:

    V31 out!

    • Removed useless File Dialog options
    • Removed useless Toolbar options and added Redo
    • New config options:
      • RENDER_CURSOR_COLOR_{R|G|B}
      • OBJECT_HEIGHT_MAX
      • OBJECT_HEIGHT_SLIDER_MAX
      • ATTR_SLIDER_REMOVAL

     

    You are a savior, this is great!

    There is one more thing I forgot to mention above, regarding the Terrain tab. It is not a bug but it would also be really lovely to have.

    We all know how the rotation axis on the Object tab works, right? 1234567 + scrollwheel to slide it (btw the 6th is not working as it is supposed to, same step as the 5th)

    Let me do an example:
    1) Press 1 or 2 to change the shape of the brush
    2) Press 3, 4, 5, 6 or 7 to change the type of the brush
    3) Press & hold 1 or 2 and scroll the wheel to slide the scale & strength sliders - this is the most crucial one

    This functionality has already been implemented for the water brush. When holding 4 or 5 and scrolling the wheel, its height changes. It also seems that the texture listBox is refreshing while doing that.

    Once again, thank you for all that you do, marty! It might seem that it is just a few details but when you think about it a bit, it is plenty of hours of work wasted on handling an unfinished UI.

    Spoiler

    Spoiler

    Spoiler

    Spoiler

    • Good 1
  4. 19 minutes ago, Ace said:

     

    Detail bro,

    even though i did not understand much of the logic of the ymir workers, they did have their reasons. This function is very helpful, especially with ATTR.

    Hmm, I cannot come up with a reasonable usage.
    Edit: Ah, ok. But there's an object output option as well which does basically the same thing.
     

    19 minutes ago, Ace said:

    Such small things are not worth changing, because it is only luxury. The most important things have already been fixed, everyone else is sure to come, but patience is required.

    Sure they are worth it. But do not get me wrong, I am not forcing anyone to do so. I am pretty ok with the v24. I just wanted to point out a few things that I noticed (based on what marty wrote above) and that would be really nice to have. Not must have.

    • Love 1
  5. 15 minutes ago, martysama0134 said:

    It toggles the wireframe of the trees, and when you enable the view->render-mode->wireframe... it toggles off... and vice versa. It's kinda broken/inverted.

    I see what you mean but it never really disappears until you restart the editor. I do not really care about it, I can live with that. I just wanted to show you what I found. It did not behave like this in the previous versions. I use the grid very often and never noticed such a thing.

    • Love 1
  6. 15 hours ago, martysama0134 said:

    The WorldEditorRemix v26 is out! (after 5 years)

    The v24 was compiled with vs2010, but the v26 is compiled with vs2019. If you find any regressions, report me all of them.

    (for the download, check the mediafire folder)

     

    Changes:

    • Fixed locale/ymir/mob_proto load (autodetect struct)
    • Fixed <map>/regen.txt save/load/edit (very nice for "m" regens)
    • Fixed ./group.txt load
    • Added water texture change in msenv (you need additional client c++ code; ignore it for now)
    • Added wind strength change in msenv (for speedtree; you need additional client c++ code; ignore it for now)
    • Fixed some crashes
    • Added generation of logs/WorldEditorRemix_{target}_{date}.dmp in case of crashes
    • Updated some icons (logo, menus)
    • Updated granny to 2.11
    • Changed WorldEditor.txt config file to WorldEditorRemix.ini
    • Load from PACK is available if property/ is missing and pack/property is present! Be sure pack/Index exists! (textureset from PACK ignores textureset/ if the relative pack exists)
    • Added config flag SERVERATTR_REMOVE_WEIRD_FLAGS

     

    Bugs to fix in the future releases:

    • ObjectList empty in PACK mode
    • SkyBox textures not cleared when switching maps
    • Some random asserts (if you get any, write me which ones, so that I at least suppress them)
    • I'll probably add some more config options

    This is awesome man, thank you a lot!

    I really like the initiative regarding different water textures. Hopefully it will come to an successful end so we do not have to rename the water folders everytime we do something like that. Really, really, big up for that! Anyway I wonder if it is a good idea to place this functionality into the .msenv since imho it is related to the map itself much more rather than to the environment even if it feels more natural like that. Maybe I'm wrong, change my mind. What I wanted to say is that I am the "keep it as clean as possible" guy in terms of the pack and I do not want to have redundant .msenv files only because of that I want to have two different maps with the same env settings but with different water textures. I think it should work more like this. It is not perfect either. You would have to change all of the maps which I belive should be done differently. Like to have some default state if no water texture info was found. Anyways this is just a spec and I believe you know what you're doing.

    The other thing is that I noticed the character's shadow now renders a bit different. I've got no problem with that, just saying.

    Regarding to the bugs or misfunctionality there is a thing that's really pi***** me off. It is the treeview in the obj tab. You cannot unselect completely which means if you want to create a new root node, you have to close the editor, create it manually in Win and relaunch the editor again. It may seem like it is not a big deal but when you work with that sw everyday it becomes frustrating after some time. Imagine that you need to relaunch VS everytime you create a new "whatever". ? And that leads me to one more thing that comes up to my mind right now. (edit: you can unselect but no root node can be created)

    I do not know how complicated it could be to recache all the stuff right from the inside of the editor. Same as for the nodes, having to relaunch the editor after you change a texture of your model becomes really frustrating after the first time you do it. :D (edit: it would be really nice to have the possibility to f.e. rightclick the object you want to reload, the context menu appears, you click reload and voilà..)

    There is really a lot of such small things and I will update this answer when I have more time and when the ideas come.

    EDIT:
    1) The trees get smhw messed up after you use the 10m grid.
    2) A "Load latest" button at the first tab or "File -> Recent -> metin2_map_latest" would be a really nice feature to have.
    3) If the attr slider under the ATTR tab in the Attribute Number GroupBox is really as useless as everyone claims, it should be removed. It only causes weird bugs (the attr higlighter starts to behave in a really weird way) and it is really easy to slide that without noticing.
    4) Not important but still buggy imho - the Fake portal CheckBox (I do not even know what is that for xD) hides all of the objects on the map.
    5) If you want to use the Goto (Alt+G) function, you cannot get over 512x512 which can be a problem sometimes. F.e. I worked on a map where there was a need to create an imaginary circle that was detected as a PvP arena by the server as you walk into it and it has never been done 100% accurately because it is barely possible to move to the center with mouse only.
    6) It is almost impossible to select the timestamps.. I love you, you fixed the timestamps in the time events of effect's particles ? It even seems it displays a lot better now

    Once again, thank you a lot! I really appreciate that you came back to us with such a huge amount of changes.

    Btw. I am truly stoked to see the encryption that is comming. Hopefully the work of great @.plechito' won't get stolen ever again.

    Best Regards,

    sandbone

    • Love 3
  7. 10 hours ago, Ciprian said:

    Hello guys,

     

    I created a serverfile and client of metin2 on my pc and I want to connect the second pc at this data base use the NAVICAT SOFTWARE, could you  explain me how can I solve this problem?

     

    Best regards.

    From what you wrote above I suppose that you are using VirtualBox or other virtualization software which means you will have to connect your 2nd PC to the same network since it is not public.

  8. 18 hours ago, Ahmed said:

    Hello Guys, I have edited all the text positions of the guild authority page as you can see but i can't edit the text position of the guild grade name on the slot

    I hope you can help me and thanks in advance ❤️

     

    wtrY74E.jpg

     

    and this is Uiguild_new.py

    import ui import net import chr import player import wndMgr import item import emotion import uiCommon import app import uiUploadMark import guild import quest import mouseModule import chat import playerSettingModule import uiToolTip import uiPickMoney_Guild import localeInfo import constInfo import dbg import skill import uiScriptLocale import time import snd import event from _weakref import proxy def unsigned32(n): return n & 0xFFFFFFFFL info_guildPage = 1 comment_guildPage = 0 authority_guildPage = 0 skill_guildPage = 0 grade_guildPage = 0 NAME_CLASS_I = "COMMENT_PAGE" FACE_IMAGE_DICT = { playerSettingModule.RACE_WARRIOR_M : "d:/ymir work/interface/faces/small/icon_mwarrior.tga", playerSettingModule.RACE_WARRIOR_W : "d:/ymir work/interface/faces/small/icon_wwarrior.tga", playerSettingModule.RACE_ASSASSIN_M : "d:/ymir work/interface/faces/small/icon_mninja.tga", playerSettingModule.RACE_ASSASSIN_W : "d:/ymir work/interface/faces/small/icon_wninja.tga", playerSettingModule.RACE_SURA_M : "d:/ymir work/interface/faces/small/icon_msura.tga", playerSettingModule.RACE_SURA_W : "d:/ymir work/interface/faces/small/icon_wsura.tga", playerSettingModule.RACE_SHAMAN_M : "d:/ymir work/interface/faces/small/icon_mshaman.tga", playerSettingModule.RACE_SHAMAN_W : "d:/ymir work/interface/faces/small/icon_wshaman.tga", } GRADE_ADD_MEMBER_AUTHORITY = 1 GRADE_REMOVE_MEMBER_AUTHORITY = 2 GRADE_NOTICE_AUTHORITY = 3 GRADE_SKILL_AUTHORITY = 4 class DeclareGuildWarDialog(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.type=0 self.__CreateDialog() def __del__(self): ui.ScriptWindow.__del__(self) def Open(self): self.inputValue.SetFocus() self.SetCenterPosition() self.SetTop() self.Show() def Close(self): self.ClearDictionary() self.board = None self.acceptButton = None self.cancelButton = None self.inputSlot = None self.inputValue = None self.Hide() def __CreateDialog(self): try: pyScrLoader = ui.PythonScriptLoader() if localeInfo.IsVIETNAM() : pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "declareguildwardialog.py") else: pyScrLoader.LoadScriptFile(self, "uiscript/declareguildwardialog.py") except: import exception exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript") try: getObject = self.GetChild self.board = getObject("Board") self.typeButtonList=[] self.typeButtonList.append(getObject("NormalButton")) self.typeButtonList.append(getObject("WarpButton")) self.typeButtonList.append(getObject("CTFButton")) self.acceptButton = getObject("AcceptButton") self.cancelButton = getObject("CancelButton") self.inputSlot = getObject("InputSlot") self.inputValue = getObject("InputValue") gameType=getObject("GameType") except: import exception exception.Abort("DeclareGuildWarWindow.__CreateDialog - BindObject") if constInfo.GUILD_WAR_TYPE_SELECT_ENABLE==0: gameType.Hide() self.typeButtonList[0].SAFE_SetEvent(self.__OnClickTypeButtonNormal) self.typeButtonList[1].SAFE_SetEvent(self.__OnClickTypeButtonWarp) self.typeButtonList[2].SAFE_SetEvent(self.__OnClickTypeButtonCTF) self.typeButtonList[0].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_NORMAL_TITLE, localeInfo.GUILDWAR_NORMAL_DESCLIST)) self.typeButtonList[1].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_WARP_TITLE, localeInfo.GUILDWAR_WARP_DESCLIST)) self.typeButtonList[2].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_CTF_TITLE, localeInfo.GUILDWAR_CTF_DESCLIST)) self.__ClickRadioButton(self.typeButtonList, 0) self.SetAcceptEvent(ui.__mem_func__(self.__OnOK)) self.SetCancelEvent(ui.__mem_func__(self.__OnCancel)) def __OnOK(self): text = self.GetText() type = self.GetType() if ""==text: return net.SendChatPacket("/war %s %d" % (text, type)) self.Close() return 1 def __OnCancel(self): self.Close() return 1 def __OnClickTypeButtonNormal(self): self.__ClickTypeRadioButton(0) def __OnClickTypeButtonWarp(self): self.__ClickTypeRadioButton(1) def __OnClickTypeButtonCTF(self): self.__ClickTypeRadioButton(2) def __ClickTypeRadioButton(self, type): self.__ClickRadioButton(self.typeButtonList, type) self.type=type def __ClickRadioButton(self, buttonList, buttonIndex): try: selButton=buttonList[buttonIndex] except IndexError: return for eachButton in buttonList: eachButton.SetUp() selButton.Down() def SetTitle(self, name): self.board.SetTitleName(name) def SetNumberMode(self): self.inputValue.SetNumberMode() def SetSecretMode(self): self.inputValue.SetSecret() def SetFocus(self): self.inputValue.SetFocus() def SetMaxLength(self, length): width = length * 6 + 10 self.inputValue.SetMax(length) self.SetSlotWidth(width) self.SetBoardWidth(max(width + 50, 160)) def SetSlotWidth(self, width): self.inputSlot.SetSize(width, self.inputSlot.GetHeight()) self.inputValue.SetSize(width, self.inputValue.GetHeight()) def SetBoardWidth(self, width): self.board.SetSize(max(width + 50, 160), self.GetHeight()) self.SetSize(max(width + 50, 160), self.GetHeight()) self.UpdateRect() def SetAcceptEvent(self, event): self.acceptButton.SetEvent(event) self.inputValue.OnIMEReturn = event def SetCancelEvent(self, event): self.board.SetCloseEvent(event) self.cancelButton.SetEvent(event) self.inputValue.OnPressEscapeKey = event def GetType(self): return self.type def GetText(self): return self.inputValue.GetText() def __CreateGameTypeToolTip(self, title, descList): toolTip = uiToolTip.ToolTip() toolTip.SetTitle(title) toolTip.AppendSpace(5) for desc in descList: toolTip.AutoAppendTextLine(desc) toolTip.AlignHorizonalCenter() return toolTip class GuildWindow(ui.ScriptWindow): GUILD_SKILL_PASSIVE_SLOT = 0 GUILD_SKILL_ACTIVE_SLOT = 1 GUILD_SKILL_AFFECT_SLOT = 2 def __init__(self): ui.ScriptWindow.__init__(self) self.state = "INFO_GUILD" self.isLoaded = 0 self.__Initialize() self.__LoadWindow() def __del__(self): ui.ScriptWindow.__del__(self) def __Initialize(self): self.tabButtonDict = None self.pageDict = None self.titleBarDict = None self.commentBoard = None self.can_continue = 1 self.objPos = 0 self.objPos2 = 0 self.objPos3 = 0 self.tooltip_in = 0 def CanOpen(self): return guild.IsGuildEnable() def Show(self): self.__LoadWindow() ui.ScriptWindow.Show(self) def __LoadScript(self, fileName): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, fileName) def __BindObject(self): self.tooltipSkill = uiToolTip.SkillToolTip() self.tooltipSkill.Hide() self.markSelectDialog=uiUploadMark.MarkSelectDialog() self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark) self.GetChild("Expand").SetEvent(self.Functie_glisare_max) self.GetChild("Minimize").SetEvent(self.Functie_glisare_min) self.GetChild("Minimize").Hide() self.TabButton1 = self.GetChild("Tab_Button_01") self.TabButton2 = self.GetChild("Tab_Button_02") self.TabButton3 = self.GetChild("Tab_Button_03") self.TabButton4 = self.GetChild("Tab_Button_04") self.TabButton5 = self.GetChild("Tab_Button_05") self.Button1Text = self.GetChild("Button1_Name") self.Button1Text.Hide() self.Button2Text = self.GetChild("Button2_Name") self.Button2Text.Hide() self.Button3Text = self.GetChild("Button3_Name") self.Button3Text.Hide() self.Button4Text = self.GetChild("Button4_Name") self.Button4Text.Hide() self.Button5Text = self.GetChild("Button5_Name") self.Button5Text.Hide() self.tabButtonDict = { "INFO_GUILD" : self.GetChild("Tab_Button_01"), "COMMENT_PAGE" : self.GetChild("Tab_Button_02"), "AUTHORITY_PAGE" : self.GetChild("Tab_Button_03"), "SKILL_PAGE" : self.GetChild("Tab_Button_04"), "GRADE_PAGE" : self.GetChild("Tab_Button_05") } self.pageDict = { "INFO_GUILD" : self.GetChild("Info_Guild"), "COMMENT_PAGE" : self.GetChild("Comment_GuildPage"), "AUTHORITY_PAGE" : self.GetChild("Authority_GuildPage"), "SKILL_PAGE" : self.GetChild("Skill_Page"), "GRADE_PAGE" : self.GetChild("Grade_Page") } self.titleBarDict = { "INFO_GUILD" : self.GetChild("Info_TitleBar"), "COMMENT_PAGE" : self.GetChild("Comment_TitleBar"), "AUTHORITY_PAGE" : self.GetChild("Authority_TitleBar"), "SKILL_PAGE" : self.GetChild("Skill_TitleBar"), "GRADE_PAGE" : self.GetChild("Grade_TitleBar") } #first_page self.info_guildPage() self.offerDialog = uiPickMoney_Guild.PickMoneyDialog_Guild() self.offerDialog.LoadDialog() self.offerDialog.SetMax(9) self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP) self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer)) #second_page self.comment_guildPage() #3'th page self.authority_guildPage() #4'th page self.skill_guildPage() #5'th page self.grade_guildPage() def info_guildPage(self): #-1 self.mark = self.GetChild("LargeGuildMark") self.mark_change = self.GetChild("GuildMark") self.mark_change.SetEvent(lambda : self.__OnClickSelectGuildMarkButton()) self.guild_level = self.GetChild("GuildLevelValue") self.guild_name = self.GetChild("GuildNameValue") self.guild_leader = self.GetChild("GuildMasterNameValue") self.level_percent = self.GetChild("PercentExp") self.curr_exp = self.GetChild("CurrentExperienceValue") self.exp_img = self.GetChild("ExpImgFull") #-2 self.guild_members = self.GetChild("GuildMemberCountValue") self.guild_members_level = self.GetChild("GuildMemberLevelAverageValue") self.guild_members_level = self.GetChild("GuildMemberLevelAverageValue") self.guild_donate_exp = self.GetChild("OfferButton") self.guild_donate_exp.SetEvent(lambda : self.__OnClickOfferButton()) self.guild_declare_war = self.GetChild("DeclareWarButton") self.guild_declare_war.SetEvent(lambda : self.__OnClickDeclareWarButton()) def __OnSelectMark(self, markFileName): ret = net.UploadMark("upload/"+markFileName) # MARK_BUG_FIX if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret: chat.AppendChat(1,localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT) return ret def __OnClickSelectGuildMarkButton(self): if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL): chat.AppendChat(1,localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL) elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE): chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION) else: self.markSelectDialog.Open() def __OnClickOfferButton(self): curEXP = unsigned32(player.GetStatus(player.EXP)) if curEXP <= 100: chat.AppendChat(1,localeInfo.GUILD_SHORT_EXP) return self.offerDialog.Open(curEXP, 100) def OnOffer(self, exp): net.SendGuildOfferPacket(exp) def __OnClickDeclareWarButton(self): inputDialog = DeclareGuildWarDialog() inputDialog.Open() self.inputDialog = inputDialog #~~~~~~~ 2 Page def comment_guildPage(self): self.commentBoard = self.GetChild("CommentBoard") self.scrollbar = ui.ScrollBarNewDesign() self.scrollbar.SetParent(self.GetChild("Comment_GuildPage")) self.scrollbar.SetPosition(342,14) self.scrollbar.SetScrollBarSize(210) self.scrollbar.SetScrollEvent(self.__OnScroll) self.scrollbar.Show() self.commentSlot = ui.SpecialEditLine() self.commentSlot.SetParent(self.GetChild("CommentBoard")) self.commentSlot.SetPosition(220,16) self.commentSlot.SetSize(121,25) self.commentSlot.SetMax(35) self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment) self.commentSlot.SetIMEFlag(0) self.commentSlot.SetPlaceHolderText("قم بكتابة الرسالة...") self.commentSlot.SetPackedFontColor(0xffa07970) self.commentSlot.Show() self.objPos = 0 self.scrollbar.SetPos(0) self.LoadScroll() #~~~~~~~ 3 Page def authority_guildPage(self): textsAuthority = {1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_RASA,3 : uiScriptLocale.GUILD_MEMBER_LEVEL, 4 : uiScriptLocale.GUILD_MEMBER_SPECIFIC_GRAVITY,5 : uiScriptLocale.GUILD_MEMBER_RANK,} self.players_Authority,u = {}, 0 for i in xrange(5): self.players_Authority = ui.TextLine() self.players_Authority.SetParent(self.GetChild("Authority_Info_3")) self.players_Authority.SetPosition(60+u,17) self.players_Authority.SetText(textsAuthority[i+1]) self.players_Authority.SetFontColor(0.902, 0.816, 0.635) self.players_Authority.Show() if i == 0: u += 60 elif i == 1 or i == 2: u += 45 else: u+= 60 self.scrollbarAuthority = ui.ScrollBarNewDesign() self.scrollbarAuthority.SetParent(self.GetChild("Authority_Info_2")) self.scrollbarAuthority.SetPosition(344,15) self.scrollbarAuthority.SetScrollBarSize(210) self.scrollbarAuthority.SetScrollEvent(self.__OnScroll2) # self.scrollbar.Show() self.objPos2 = 0 self.scrollbarAuthority.SetPos(0) self.LoadScroll2() pass def LoadScroll2(self): curMemberCount, maxMemberCount = guild.GetGuildMemberCount() pos = self.objPos2 if curMemberCount >= 5: self.obj_count2 = 5 self.scrollbarAuthority.Show() else: self.obj_count2 = curMemberCount self.scrollbarAuthority.Hide() z=0 self.players, u = {}, 0 self.namesAuthority,self.imgs,self.levels,self.inverts,self.pos = {},{},{},{},{} for i in xrange(self.obj_count2): realPos = pos+i pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos) if not name or name == "": break guildExperienceSummary = guild.GetGuildExperienceSummary() offerPercentage = 0 if guildExperienceSummary > 0: offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0) self.players = ui.ImageBox() self.players.SetParent(self.GetChild("Authority_Info_2")) self.players.SetPosition(25,20+u) self.players.LoadImage("d:/ymir work/interface/guild/dialog_member_slot.tga") self.players.Show() self.pos = ui.NewComboBox() self.pos.SetParent(self.players) self.pos.SetPosition(218,3) self.pos.SetSize(90,23) self.pos.SetCurrentItem(guild.GetGradeName(grade)) masterName = guild.GetGuildMasterName() mainCharacterName = player.GetMainCharacterName() if mainCharacterName == masterName: self.pos.Enable() self.pos.SetEvent(lambda gradeNumber, lineIndex=realPos, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber)) self.pos.Show() self.pos.ClearItem() for e in xrange(14): self.pos.InsertItem(e+2, guild.GetGradeName(e+2)) self.pos.SetCurrentItem(guild.GetGradeName(grade)) self.namesAuthority = ui.TextLine() self.namesAuthority.SetParent(self.players) self.namesAuthority.SetPosition(50,7) self.namesAuthority.SetText(name) self.namesAuthority.SetFontColor(0.902, 0.816, 0.635) self.namesAuthority.Show() self.imgs = ui.ImageBox() self.imgs.SetParent(self.players) self.imgs.SetPosition(93,2) self.imgs.LoadImage(FACE_IMAGE_DICT[race]) self.imgs.Show() self.levels = ui.TextLine() self.levels.SetParent(self.players) self.levels.SetPosition(160,7) self.levels.SetText(str(level)) self.levels.SetFontColor(0.424, 0.337, 0.329) self.levels.Show() self.inverts = ui.TextLine() self.inverts.SetParent(self.players) self.inverts.SetPosition(195,7) self.inverts.SetText(str(offerPercentage)+"%") self.inverts.SetFontColor(0.424, 0.337, 0.329) self.inverts.Show() u+= 30 def __OnScroll2(self): curMemberCount, maxMemberCount = guild.GetGuildMemberCount() self.objPos2 = self.scrollbarAuthority.GetPos() * (curMemberCount-6) self.LoadScroll2() def OnChangeMemberGrade(self, id, gradeNumber): PID = guild.MemberIndexToPID(id) net.SendGuildChangeMemberGradePacket(PID, gradeNumber) self.objPos2 = 0 self.scrollbarAuthority.SetPos(0) self.LoadScroll2() def RefAuthMember(self): curMemberCount, maxMemberCount = guild.GetGuildMemberCount() if curMemberCount >= 5: self.obj_count2 = 5 else: self.obj_count2 = curMemberCount pos = self.objPos2 for i in xrange(self.obj_count2): realPos = pos+i pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos) if not name or name == "": break guildExperienceSummary = guild.GetGuildExperienceSummary() offerPercentage = 0 if guildExperienceSummary > 0: offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0) if self.inverts != 0: self.inverts.SetText(str(offerPercentage)+"%") self.pos.SetCurrentItem(guild.GetGradeName(grade)) if self.pos[int(realPos)].CheckOpen() == 1: self.open = 1 for e in xrange(self.obj_count2): self.pos[e].Hide() self.pos[int(realPos)].Show() def skill_guildPage(self): self.skillPoints = self.GetChild("Skill_Plus_Value") self.energy = self.GetChild("Dragon_God_Power_Value") self.energyBar = self.GetChild("EnergyFull") self.donate_energy = self.GetChild("DonateEnergyButton") self.donate_energy.SetEvent(lambda : self.__OnOpenHealGSPBoard()) self.backSlot = ui.GridSlotWindow() self.backSlot.SetParent(self.GetChild("Skill_Page")) self.backSlot.SetPosition(30-25,80) self.backSlot.ArrangeSlot(210, 6, 1, 40, 40,3,0) self.backSlot.SetSlotBaseImage("d:/ymir work/interface/slot/slot3.tga",1.0,1.0,1.0,1.0) self.backSlot.SetWindowHorizontalAlignCenter() self.backSlot.Show() self.activeSlot = ui.GridSlotWindow() self.activeSlot.SetParent(self.GetChild("Skill_Page")) self.activeSlot.SetPosition(34-25,84) self.activeSlot.ArrangeSlot(210, 6, 1, 40, 40,3,0) self.activeSlot.SetSlotBaseImage("d:/ymir work/ui/slot.tga",1.0,1.0,1.0,1.0) self.activeSlot.SetWindowHorizontalAlignCenter() self.activeSlot.Show() self.activeSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE) self.activeSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type)) self.activeSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem)) self.activeSlot.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type)) self.activeSlot.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type)) self.activeSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type)) self.activeSlot.AppendSlotButton("d:/ymir work/interface/button/char_buttons/plus_01_normal.tga",\ "d:/ymir work/interface/button/char_buttons/plus_02_hover.tga",\ "d:/ymir work/interface/button/char_buttons/plus_03_active.tga") ## Active for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)): slotIndex = self.activeSlot.GetStartIndex()+i skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST self.activeSlot.SetSkillSlot(slotIndex, skillIndex, 0) self.activeSlot.SetCoverButton(slotIndex) self.activeSlot.RefreshSlot() guild.SetSkillIndex(slotIndex, len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)+i) def RefreshGuildSkillPage(self): if 0 != 0: return # page = self.pageDict["MUSIC"] curPoint, maxPoint = guild.GetDragonPowerPoint() maxPoint = max(maxPoint, 1) self.energy.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+ "|cfff8d090 " +str(curPoint) + " / " + str(maxPoint)) percentage = ( (float(curPoint / max(1, float(maxPoint))) * 100)) self.energyBar.SetPercentage(curPoint,maxPoint) skillPoint = guild.GetGuildSkillPoint() self.skillPoints.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS + "|cfff8d090 " +str(skillPoint)) # page.passiveSlot.HideAllSlotButton() self.activeSlot.HideAllSlotButton() ## Active for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)): slotIndex = self.activeSlot.GetStartIndex()+i skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST skillLevel = guild.GetSkillLevel(slotIndex) skillMaxLevel = skill.GetSkillMaxLevel(skillIndex) self.activeSlot.SetSlotCount(slotIndex, skillLevel) if skillLevel <= 0: self.activeSlot.DisableCoverButton(slotIndex) else: self.activeSlot.EnableCoverButton(slotIndex) if skillPoint > 0: if skillLevel < skillMaxLevel: self.activeSlot.ShowSlotButton(slotIndex) 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 0 != 0: return # self.activeSlot = ui.GridSlotWindow() if self.activeSlot.HasSlot(slotNumber): self.activeSlot.SetSlotCoolTime(slotNumber, coolTime) 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): self.tooltipSkill.HideToolTip() self.tooltip_in = 0 def SetSkillToolTip(self, tooltipSkill): self.tooltipSkill = tooltipSkill def __OnOpenHealGSPBoard(self): curPoint, maxPoint = guild.GetDragonPowerPoint() if maxPoint - curPoint <= 0: chat.AppendChat(1,localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE) return pickDialog = uiPickMoney_Guild.PickMoneyDialog_Guild() 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 grade_guildPage(self): textsGrade = {0 : "رقم.", 1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_GRADE_PERMISSION_JOIN,3 : uiScriptLocale.GUILD_GRADE_PERMISSION_DELETE, 4 : uiScriptLocale.GUILD_GRADE_PERMISSION_NOTICE,5 : uiScriptLocale.GUILD_GRADE_PERMISSION_SKILL,} self.players_t,u = {}, 0 for i in xrange(6): self.players_t = ui.TextLine() self.players_t.SetParent(self.GetChild("Grade_Page")) self.players_t.SetPosition(30+u,17) self.players_t.SetText(textsGrade) self.players_t.SetFontColor(0.902, 0.816, 0.635) self.players_t.Show() if i == 0: u += 45 elif i == 1: u += 65 elif i == 2: u += 40 elif i == 3: u+= 65 else: u+= 45 self.status11 = ui.NewBoard() self.status11.SetParent(self.GetChild("Grade_Page")) self.status11.SetSize(363,265) self.status11.SetPosition(0,33+12) self.status11.Show() self.scrollbarGrade = ui.ScrollBarNewDesign() self.scrollbarGrade.SetParent(self.status11) self.scrollbarGrade.SetPosition(342,15) self.scrollbarGrade.SetScrollBarSize(243) self.scrollbarGrade.SetScrollEvent(self.__OnScroll3) self.scrollbarGrade.Show() self.objPos3 = 0 self.scrollbarGrade.SetPos(0) self.LoadScroll3() def RefGradeGuild(self): if 11 >= 9: self.obj_count3 = 9 else: self.obj_count3 = 13 pos = self.objPos3 for i in xrange(1,self.obj_count3): realPos = pos+i name, authority = guild.GetGradeData(int(realPos)) self.checkbox.SetCheck(authority & guild.AUTH_ADD_MEMBER) self.checkbox4.SetCheck(authority & guild.AUTH_SKILL) self.checkbox3.SetCheck(authority & guild.AUTH_NOTICE) self.checkbox2.SetCheck(authority & guild.AUTH_REMOVE_MEMBER) self.namesGrage.SetText(name) def LoadScroll3(self): total = 13 pos = self.objPos3 if total >= 9: self.obj_count3 = 9 else: self.obj_count3 = total z=0 self.img_rank, u = {}, 0 self.idx = {} self.checkbox,self.checkbox2,self.checkbox3,self.checkbox4 = {},{},{},{} self.namesGrage = {} for i in xrange(1,self.obj_count3): realPos = pos+i name, authority = guild.GetGradeData(int(realPos)) self.img_rank = ui.ExpandedImageBox() self.img_rank.SetParent(self.status11) self.img_rank.SetPosition(20,12+u) self.img_rank.LoadImage("d:/ymir work/interface/guild/dialog_rank_slot.tga") self.img_rank.Show() self.idx = ui.TextLine() self.idx.SetParent(self.img_rank) self.idx.SetPosition(10,6) self.idx.SetText(str(int(realPos))+".") self.idx.SetPackedFontColor(0xffcaa76f) self.idx.Show() self.namesGrage = ui.EditableTextSlot(self.img_rank, 30, 2) self.namesGrage.SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), i) self.namesGrage.SetText(name) self.namesGrage.Show() event1 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) event2 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) event3 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) event4 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority)) self.checkbox = ui.CheckBox(self.img_rank,122,3,event1) self.checkbox2 = ui.CheckBox(self.img_rank,173,3,event2) self.checkbox3 = ui.CheckBox(self.img_rank,225,3,event3) self.checkbox4 = ui.CheckBox(self.img_rank,275,3,event4) self.checkbox.SetCheck(authority & guild.AUTH_ADD_MEMBER) self.checkbox4.SetCheck(authority & guild.AUTH_SKILL) self.checkbox3.SetCheck(authority & guild.AUTH_NOTICE) self.checkbox2.SetCheck(authority & guild.AUTH_REMOVE_MEMBER) u += 30 def __OnScroll3(self): self.objPos3 = self.scrollbarGrade.GetPos() * (14-10) self.LoadScroll3() def OnCheckAuthority(self, argIndex, argAuthority): name, authority = guild.GetGradeData(argIndex) net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority) def OnChangeGradeName(self, gradeNumber): if len(gradeName) == 0: gradeName = localeInfo.GUILD_DEFAULT_GRADE net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName) return TRUE def OnOpenChangeGradeName(self, arg): self.cambiar = arg self.a = uiCommon.InputDialog() self.a.SetTitle("تغيير الرتبة") self.a.SetAcceptEvent(ui.__mem_func__(self.__OnchangeName)) self.a.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog2)) self.a.Open() def __OnchangeName(self): gradeName = self.a.GetText() if len(gradeName) == 0: gradeName = localeInfo.GUILD_DEFAULT_GRADE net.SendGuildChangeGradeNamePacket(self.cambiar, gradeName) self.__OnCloseQuestionDialog2() def __OnCloseQuestionDialog2(self): if self.a: self.a.Close() self.cambiar = None self.a = None def OnUpdate(self): #-1 self.mark.SetIndex(net.GetGuildID()) self.mark.SetScale(3.3) self.guild_level.SetText(str(guild.GetGuildLevel())) self.guild_name.SetText(guild.GetGuildName()) self.guild_leader.SetText(player.GetName()) curExp, lastExp = guild.GetGuildExperience() curExp *= 100 lastExp *= 100 total = curExp + lastExp self.exp_img.SetPercentage(curExp,total) self.curr_exp.SetText("EXP: "+str(curExp)+ " " +uiScriptLocale.CHARACTER_FROM +" "+str(total)) self.level_percent.SetText("%s %.2f%%" % ("", float(curExp) / max(1, float(total)) * 100)) #-1 #-2 curMemberCount, maxMemberCount = guild.GetGuildMemberCount() self.guild_members.SetText(str(curMemberCount)+" / "+str(maxMemberCount)) self.guild_members_level.SetText(str(guild.GetGuildMemberLevelAverage())) #-2 #-4 self.RefAuthMember() #-4 #-5 self.RefreshGuildSkillPage() #-5 #-6 self.RefGradeGuild() pass def Functie_glisare_max(self): latime = self.GetChild("board").GetWidth() latime2 = self.GetChild("TabButtonsBoard").GetWidth() if latime < 467+48+39: latime = latime+2 latime2 = latime2+2 self.SetSize(latime,300) self.GetChild("board").SetSize(latime,340+10) self.GetChild("TabButtonsBoard").SetSize(latime2,300+10) self.GetChild("Authority_TitleBar").SetWidth(latime-15) self.GetChild("Skill_TitleBar").SetWidth(latime-15) self.GetChild("Grade_TitleBar").SetWidth(latime-15) self.GetChild("Comment_TitleBar").SetWidth(latime-15) self.GetChild("Info_TitleBar").SetWidth(latime-15) self.GetChild("Expand").SetPosition(latime-15-70, 10) self.GetChild("Minimize").SetPosition(latime-15-70, 10) self.GetChild("TitleName").SetPosition(0, 12-172) self.glisare = WaitingDialog() self.glisare.Open(0.0) self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_max) else: self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") if info_guildPage == 1: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") if comment_guildPage == 1: self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") else: self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") if authority_guildPage == 1: self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") else: self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") if skill_guildPage == 1: self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") else: self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") if grade_guildPage == 1: self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") else: self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.Button1Text.Show() self.Button2Text.Show() self.Button3Text.Show() self.Button4Text.Show() self.Button5Text.Show() self.GetChild("Minimize").Show() self.GetChild("Expand").Hide() def Functie_glisare_min(self): latime = self.GetChild("board").GetWidth() latime2 = self.GetChild("TabButtonsBoard").GetWidth() self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") if info_guildPage == 1: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if comment_guildPage == 1: self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") else: self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if authority_guildPage == 1: self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") else: self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if skill_guildPage == 1: self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") else: self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if grade_guildPage == 1: self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") else: self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.Button1Text.Hide() self.Button2Text.Hide() self.Button3Text.Hide() self.Button4Text.Hide() self.Button5Text.Hide() if latime>340+47+39: latime = latime-2 latime2 = latime2-2 self.SetSize(latime,300) self.GetChild("board").SetSize(latime,340+10) self.GetChild("TabButtonsBoard").SetSize(latime2,300+10) self.GetChild("Authority_TitleBar").SetWidth(latime-15) self.GetChild("Skill_TitleBar").SetWidth(latime-15) self.GetChild("Grade_TitleBar").SetWidth(latime-15) self.GetChild("Comment_TitleBar").SetWidth(latime-15) self.GetChild("Info_TitleBar").SetWidth(latime-15) self.GetChild("Expand").SetPosition(latime-15-70, 10) self.GetChild("Minimize").SetPosition(latime-15-70, 10) self.GetChild("TitleName").SetPosition(0, 12-172) self.glisare = WaitingDialog() self.glisare.Open(0.0) self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_min) else: self.GetChild("Expand").Show() self.GetChild("Minimize").Hide() def __BindEvent(self): for (tabKey, tabButton) in self.tabButtonDict.items(): tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey) for titleBarValue in self.titleBarDict.itervalues(): titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide)) def __LoadWindow(self): if self.isLoaded == 1: return self.isLoaded = 1 try: if localeInfo.IsARABIC() or localeInfo.IsVIETNAM() or localeInfo.IsJAPAN(): self.__LoadScript("uiscript/GuildWindow.py") else: self.__LoadScript("uiscript/GuildWindow.py") self.__BindObject() self.__BindEvent() except: import exception exception.Abort("OptionWindow.__LoadWindow") self.SetState("INFO_GUILD") def Destroy(self): self.ClearDictionary() self.__Initialize() def Close(self): self.Hide() def __OnClickTabButton(self, stateKey): global info_guildPage,comment_guildPage,authority_guildPage,skill_guildPage,grade_guildPage latime = self.GetWidth() if stateKey == "INFO_GUILD": info_guildPage = 1 comment_guildPage = 0 authority_guildPage = 0 skill_guildPage = 0 grade_guildPage = 0 if latime == 468+48+39: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.Button1Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_1) self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2) self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3) self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4) self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5) else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if stateKey == "COMMENT_PAGE": info_guildPage = 0 comment_guildPage = 1 authority_guildPage = 0 skill_guildPage = 0 grade_guildPage = 0 if latime == 468+48+39: net.SendGuildRefreshCommentsPacket(0) self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1) self.Button2Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_2) self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3) self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4) self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5) else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if stateKey == "AUTHORITY_PAGE": info_guildPage = 0 comment_guildPage = 0 authority_guildPage = 1 skill_guildPage = 0 grade_guildPage = 0 if latime == 468+48+39: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1) self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2) self.Button3Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_3) self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4) self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5) else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if stateKey == "SKILL_PAGE": info_guildPage = 0 comment_guildPage = 0 authority_guildPage = 0 skill_guildPage = 1 grade_guildPage = 0 if latime == 468+48+39: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1) self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2) self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3) self.Button4Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_4) self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5) else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") if stateKey == "GRADE_PAGE": info_guildPage = 0 comment_guildPage = 0 authority_guildPage = 0 skill_guildPage = 0 grade_guildPage = 1 if latime == 468+48+39: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga") self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1) self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2) self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3) self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4) self.Button5Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_5) else: self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga") self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga") self.SetState(stateKey) def SetState(self, stateKey): self.state = stateKey if constInfo.ENABLE_FIX_CHARACTER_PAGE: if stateKey == NAME_CLASS_I: self.OnRefreshComments() for (tabKey, tabButton) in self.tabButtonDict.items(): if stateKey!=tabKey: tabButton.SetUp() for pageValue in self.pageDict.itervalues(): pageValue.Hide() for titleBarValue in self.titleBarDict.itervalues(): titleBarValue.Hide() self.titleBarDict[stateKey].Show() self.pageDict[stateKey].Show() 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 OnPostComment(self): text = self.commentSlot.GetText() if not text: return FALSE if not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE): chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION) return net.SendGuildPostCommentPacket(text[:50]) self.commentSlot.SetText("") self.objPos = 0 self.scrollbar.SetPos(0) self.LoadScroll() return TRUE def OnDeleteComment(self, index): commentID, chrName, comment = self.__GetGuildBoardCommentData(index) net.SendGuildDeleteCommentPacket(commentID) self.LoadScroll() def OnRefreshComments(self): net.SendGuildRefreshCommentsPacket(0) def __OnScroll(self): self.OnRefreshComments() self.objPos = self.scrollbar.GetPos() * (guild.GetGuildBoardCommentCount()-6) self.LoadScroll() def LoadScroll(self): net.SendGuildRefreshCommentsPacket(0) pos = self.objPos if guild.GetGuildBoardCommentCount() >= 6: self.obj_count = 6 self.scrollbar.Show() else: self.obj_count = guild.GetGuildBoardCommentCount() self.scrollbar.Hide() self.delete,self.important, self.spaces,self.namesCommand,self.comments, u = {},{},{},{},{}, 0 for i in xrange(self.obj_count): realPos = pos+i commentID, chrName, comment = self.__GetGuildBoardCommentData(realPos) if chrName == "Noname": break self.spaces = ui.ImageBox() self.spaces.SetParent(self.GetChild("Comment_GuildPage")) self.spaces.SetPosition(20,20+u) self.spaces.LoadImage("d:/ymir work/interface/guild/dialog_message_slot.tga") self.spaces.Show() self.namesCommand = ui.TextLine() self.namesCommand.SetParent(self.spaces) self.namesCommand.SetPosition(50,8) self.namesCommand.SetText(chrName) self.namesCommand.SetPackedFontColor(0xffcaa76f) self.namesCommand.Show() self.important = ui.ImageBox() self.important.SetParent(self.spaces) self.important.SetPosition(87,8) self.important.LoadImage("d:/ymir work/interface/guild/dialog_message_importantmsg.tga") self.comments = ui.TextLine() self.comments.SetParent(self.spaces) self.comments.SetPosition(310,8) if "!" == comment[0]: self.comments.SetText(comment[1:]) self.comments.SetPackedFontColor(0xffdb9b93) self.important.Show() else: self.comments.SetText(comment) self.comments.SetPackedFontColor(0xffa08784) self.comments.Show() masterName = guild.GetGuildMasterName() mainCharacterName = player.GetMainCharacterName() if mainCharacterName == chrName or (masterName == mainCharacterName): self.delete = ui.Button() self.delete.SetParent(self.spaces) self.delete.SetPosition(305,7) self.delete.SetUpVisual("d:/ymir work/interface/guild/close_mini_01_normal.tga") self.delete.SetOverVisual("d:/ymir work/interface/guild/close_mini_02_hover.tga") self.delete.SetDownVisual("d:/ymir work/interface/guild/close_mini_03_active.tga") self.delete.SetEvent(lambda x = realPos: self.OnDeleteComment(x)) self.delete.Show() u += 35 def GetState(self): return self.state def OnPressExitKey(self): self.Close() return TRUE def OnPressEscapeKey(self): self.Close() return TRUE class WaitingDialog(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.eventTimeOver = lambda *arg: None self.eventExit = lambda *arg: None def __del__(self): ui.ScriptWindow.__del__(self) def Open(self, waitTime): import time curTime = time.clock() self.endTime = curTime + waitTime self.Show() def Close(self): self.Hide() def Destroy(self): self.Hide() def SAFE_SetTimeOverEvent(self, event): self.eventTimeOver = ui.__mem_func__(event) def SAFE_SetExitEvent(self, event): self.eventExit = ui.__mem_func__(event) def OnUpdate(self): import time lastTime = max(0, self.endTime - time.clock()) if 0 == lastTime: self.Close() self.eventTimeOver() else: return def OnPressEscapeKey(self): self.Close() return TRUE def OnPressExitKey(self): self.Close() return TRUE

    
    import ui
    import net
    import chr
    import player
    import wndMgr
    import item
    import emotion
    import uiCommon
    import app
    import uiUploadMark
    import guild
    import quest
    import mouseModule
    import chat
    import playerSettingModule
    import uiToolTip
    import uiPickMoney_Guild
    import localeInfo
    import constInfo
    import dbg
    import skill
    import uiScriptLocale
    import time
    import snd
    import event
    from _weakref import proxy
    
    def unsigned32(n):
    	return n & 0xFFFFFFFFL
    
    info_guildPage = 1
    comment_guildPage = 0
    authority_guildPage = 0
    skill_guildPage = 0
    grade_guildPage = 0
    
    NAME_CLASS_I = "COMMENT_PAGE"
    
    FACE_IMAGE_DICT = {
    	playerSettingModule.RACE_WARRIOR_M	: "d:/ymir work/interface/faces/small/icon_mwarrior.tga",
    	playerSettingModule.RACE_WARRIOR_W	: "d:/ymir work/interface/faces/small/icon_wwarrior.tga",
    	playerSettingModule.RACE_ASSASSIN_M	: "d:/ymir work/interface/faces/small/icon_mninja.tga",
    	playerSettingModule.RACE_ASSASSIN_W	: "d:/ymir work/interface/faces/small/icon_wninja.tga",
    	playerSettingModule.RACE_SURA_M		: "d:/ymir work/interface/faces/small/icon_msura.tga",
    	playerSettingModule.RACE_SURA_W		: "d:/ymir work/interface/faces/small/icon_wsura.tga",
    	playerSettingModule.RACE_SHAMAN_M	: "d:/ymir work/interface/faces/small/icon_mshaman.tga",
    	playerSettingModule.RACE_SHAMAN_W	: "d:/ymir work/interface/faces/small/icon_wshaman.tga",
    }
    
    GRADE_ADD_MEMBER_AUTHORITY = 1
    GRADE_REMOVE_MEMBER_AUTHORITY = 2
    GRADE_NOTICE_AUTHORITY = 3
    GRADE_SKILL_AUTHORITY = 4
    
    class DeclareGuildWarDialog(ui.ScriptWindow):
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    
    		self.type=0
    		self.__CreateDialog()
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def Open(self):
    		self.inputValue.SetFocus()
    		self.SetCenterPosition()
    		self.SetTop()
    		self.Show()
    
    	def Close(self):
    		self.ClearDictionary()
    		self.board = None
    		self.acceptButton = None
    		self.cancelButton = None
    		self.inputSlot = None
    		self.inputValue = None
    		self.Hide()
    
    	def __CreateDialog(self):
    
    		try:
    			pyScrLoader = ui.PythonScriptLoader()
    
    			if localeInfo.IsVIETNAM() :
    				pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "declareguildwardialog.py")
    			else:
    				pyScrLoader.LoadScriptFile(self, "uiscript/declareguildwardialog.py")
    
    		except:
    			import exception
    			exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript")
    
    		try:
    			getObject = self.GetChild
    			self.board = getObject("Board")
    
    			self.typeButtonList=[]
    			self.typeButtonList.append(getObject("NormalButton"))
    			self.typeButtonList.append(getObject("WarpButton"))
    			self.typeButtonList.append(getObject("CTFButton"))
    
    			self.acceptButton = getObject("AcceptButton")
    			self.cancelButton = getObject("CancelButton")
    			self.inputSlot = getObject("InputSlot")
    			self.inputValue = getObject("InputValue")
    
    			gameType=getObject("GameType")
    
    		except:
    			import exception
    			exception.Abort("DeclareGuildWarWindow.__CreateDialog - BindObject")
    
    		if constInfo.GUILD_WAR_TYPE_SELECT_ENABLE==0:
    			gameType.Hide()
    
    		self.typeButtonList[0].SAFE_SetEvent(self.__OnClickTypeButtonNormal)
    		self.typeButtonList[1].SAFE_SetEvent(self.__OnClickTypeButtonWarp)
    		self.typeButtonList[2].SAFE_SetEvent(self.__OnClickTypeButtonCTF)
    
    		self.typeButtonList[0].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_NORMAL_TITLE, localeInfo.GUILDWAR_NORMAL_DESCLIST))
    		self.typeButtonList[1].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_WARP_TITLE, localeInfo.GUILDWAR_WARP_DESCLIST))
    		self.typeButtonList[2].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_CTF_TITLE, localeInfo.GUILDWAR_CTF_DESCLIST))
    
    		self.__ClickRadioButton(self.typeButtonList, 0)
    
    		self.SetAcceptEvent(ui.__mem_func__(self.__OnOK))
    		self.SetCancelEvent(ui.__mem_func__(self.__OnCancel))
    
    	def __OnOK(self):
    		text = self.GetText()
    		type = self.GetType()
    
    		if ""==text:
    			return
    
    		net.SendChatPacket("/war %s %d" % (text, type))
    		self.Close()
    
    		return 1
    
    	def __OnCancel(self):
    		self.Close()
    		return 1
    
    	def __OnClickTypeButtonNormal(self):
    		self.__ClickTypeRadioButton(0)
    
    	def __OnClickTypeButtonWarp(self):
    		self.__ClickTypeRadioButton(1)
    
    	def __OnClickTypeButtonCTF(self):
    		self.__ClickTypeRadioButton(2)
    
    	def __ClickTypeRadioButton(self, type):
    		self.__ClickRadioButton(self.typeButtonList, type)
    		self.type=type
    
    	def __ClickRadioButton(self, buttonList, buttonIndex):
    		try:
    			selButton=buttonList[buttonIndex]
    		except IndexError:
    			return
    
    		for eachButton in buttonList:
    			eachButton.SetUp()
    
    		selButton.Down()
    
    	def SetTitle(self, name):
    		self.board.SetTitleName(name)
    
    	def SetNumberMode(self):
    		self.inputValue.SetNumberMode()
    
    	def SetSecretMode(self):
    		self.inputValue.SetSecret()
    
    	def SetFocus(self):
    		self.inputValue.SetFocus()
    
    	def SetMaxLength(self, length):
    		width = length * 6 + 10
    		self.inputValue.SetMax(length)
    		self.SetSlotWidth(width)
    		self.SetBoardWidth(max(width + 50, 160))
    
    	def SetSlotWidth(self, width):
    		self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
    		self.inputValue.SetSize(width, self.inputValue.GetHeight())
    
    	def SetBoardWidth(self, width):
    		self.board.SetSize(max(width + 50, 160), self.GetHeight())
    		self.SetSize(max(width + 50, 160), self.GetHeight())
    		self.UpdateRect()
    
    	def SetAcceptEvent(self, event):
    		self.acceptButton.SetEvent(event)
    		self.inputValue.OnIMEReturn = event
    
    	def SetCancelEvent(self, event):
    		self.board.SetCloseEvent(event)
    		self.cancelButton.SetEvent(event)
    		self.inputValue.OnPressEscapeKey = event
    
    	def GetType(self):
    		return self.type
    
    	def GetText(self):
    		return self.inputValue.GetText()
    
    	def __CreateGameTypeToolTip(self, title, descList):
    		toolTip = uiToolTip.ToolTip()
    		toolTip.SetTitle(title)
    		toolTip.AppendSpace(5)
    
    		for desc in descList:
    			toolTip.AutoAppendTextLine(desc)
    
    		toolTip.AlignHorizonalCenter()
    		return toolTip
    
    
    class GuildWindow(ui.ScriptWindow):
    	
    	GUILD_SKILL_PASSIVE_SLOT = 0
    	GUILD_SKILL_ACTIVE_SLOT = 1
    	GUILD_SKILL_AFFECT_SLOT = 2
    
    
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    		self.state = "INFO_GUILD"
    		self.isLoaded = 0
    
    		self.__Initialize()
    		self.__LoadWindow()
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def __Initialize(self):
    		self.tabButtonDict = None
    		self.pageDict = None
    		self.titleBarDict = None
    
    		self.commentBoard = None
    		self.can_continue = 1
    		self.objPos = 0
    		self.objPos2 = 0
    		self.objPos3 = 0
    		self.tooltip_in = 0
    		
    	def CanOpen(self):
    		return guild.IsGuildEnable()
    	
    	def Show(self):
    		self.__LoadWindow()
    		ui.ScriptWindow.Show(self)
    		
    
    	def __LoadScript(self, fileName):
    		pyScrLoader = ui.PythonScriptLoader()
    		pyScrLoader.LoadScriptFile(self, fileName)	
    		
    	def __BindObject(self):
    		self.tooltipSkill = uiToolTip.SkillToolTip()
    		self.tooltipSkill.Hide()
    		
    		
    		self.markSelectDialog=uiUploadMark.MarkSelectDialog()
    		self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark)
    		
    		
    		self.GetChild("Expand").SetEvent(self.Functie_glisare_max)
    		self.GetChild("Minimize").SetEvent(self.Functie_glisare_min)
    		self.GetChild("Minimize").Hide()
    	
    	
    		self.TabButton1 = self.GetChild("Tab_Button_01")
    		self.TabButton2 = self.GetChild("Tab_Button_02")
    		self.TabButton3 = self.GetChild("Tab_Button_03")
    		self.TabButton4 = self.GetChild("Tab_Button_04")
    		self.TabButton5 = self.GetChild("Tab_Button_05")
    		
    		self.Button1Text = self.GetChild("Button1_Name")
    		self.Button1Text.Hide()
    		self.Button2Text = self.GetChild("Button2_Name")
    		self.Button2Text.Hide()
    		self.Button3Text = self.GetChild("Button3_Name")
    		self.Button3Text.Hide()
    		self.Button4Text = self.GetChild("Button4_Name")
    		self.Button4Text.Hide()
    		self.Button5Text = self.GetChild("Button5_Name")
    		self.Button5Text.Hide()
    
    		self.tabButtonDict = {
    			"INFO_GUILD"	: self.GetChild("Tab_Button_01"),
    			"COMMENT_PAGE"		: self.GetChild("Tab_Button_02"),
    			"AUTHORITY_PAGE"		: self.GetChild("Tab_Button_03"),
    			"SKILL_PAGE"	: self.GetChild("Tab_Button_04"),
    			"GRADE_PAGE"		: self.GetChild("Tab_Button_05")
    		}
    
    		self.pageDict = {
    			"INFO_GUILD"	: self.GetChild("Info_Guild"),
    			"COMMENT_PAGE"	: self.GetChild("Comment_GuildPage"),
    			"AUTHORITY_PAGE"		: self.GetChild("Authority_GuildPage"),
    			"SKILL_PAGE"	: self.GetChild("Skill_Page"),
    			"GRADE_PAGE"		: self.GetChild("Grade_Page")
    		}
    
    		self.titleBarDict = {
    			"INFO_GUILD"	: self.GetChild("Info_TitleBar"),
    			"COMMENT_PAGE"	: self.GetChild("Comment_TitleBar"),
    			"AUTHORITY_PAGE"		: self.GetChild("Authority_TitleBar"),
    			"SKILL_PAGE"	: self.GetChild("Skill_TitleBar"),
    			"GRADE_PAGE"		: self.GetChild("Grade_TitleBar")
    		}
    		#first_page
    		self.info_guildPage()
    		
    		self.offerDialog = uiPickMoney_Guild.PickMoneyDialog_Guild()
    		self.offerDialog.LoadDialog()
    		self.offerDialog.SetMax(9)
    		self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP)
    		self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer))
    		
    		#second_page
    		self.comment_guildPage()
    	
    		#3'th page
    		self.authority_guildPage()
    		
    		#4'th page
    		self.skill_guildPage()
    		
    		#5'th page
    		self.grade_guildPage()
    		
    	def info_guildPage(self):
    		#-1
    		self.mark = self.GetChild("LargeGuildMark")
    		self.mark_change = self.GetChild("GuildMark")
    		self.mark_change.SetEvent(lambda : self.__OnClickSelectGuildMarkButton())
    		
    		self.guild_level = self.GetChild("GuildLevelValue")
    		self.guild_name = self.GetChild("GuildNameValue")
    		self.guild_leader = self.GetChild("GuildMasterNameValue")
    		self.level_percent = self.GetChild("PercentExp")
    		self.curr_exp = self.GetChild("CurrentExperienceValue")
    		self.exp_img = self.GetChild("ExpImgFull")
    		#-2
    		self.guild_members = self.GetChild("GuildMemberCountValue")
    		self.guild_members_level = self.GetChild("GuildMemberLevelAverageValue")
    		self.guild_members_level = self.GetChild("GuildMemberLevelAverageValue")
    		
    		self.guild_donate_exp = self.GetChild("OfferButton")
    		self.guild_donate_exp.SetEvent(lambda : self.__OnClickOfferButton())
    		
    		self.guild_declare_war = self.GetChild("DeclareWarButton")
    		self.guild_declare_war.SetEvent(lambda : self.__OnClickDeclareWarButton())
    		
    
    	def __OnSelectMark(self, markFileName):
    		ret = net.UploadMark("upload/"+markFileName)
    
    		# MARK_BUG_FIX
    		if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret:
    			chat.AppendChat(1,localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT)
    		return ret
    		
    	def __OnClickSelectGuildMarkButton(self):
    		if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL):
    			chat.AppendChat(1,localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL)
    		elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
    			chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION)
    		else:
    			self.markSelectDialog.Open()
    	
    	def __OnClickOfferButton(self):
    
    		curEXP = unsigned32(player.GetStatus(player.EXP))
    
    		if curEXP <= 100:
    			chat.AppendChat(1,localeInfo.GUILD_SHORT_EXP)
    			return
    
    		self.offerDialog.Open(curEXP, 100)
    
    	def OnOffer(self, exp):
    		net.SendGuildOfferPacket(exp)
    	
    	def __OnClickDeclareWarButton(self):
    		inputDialog = DeclareGuildWarDialog()
    		inputDialog.Open()
    		self.inputDialog = inputDialog
    	
    	
    	#~~~~~~~ 2 Page
    	
    	def comment_guildPage(self):
    		self.commentBoard = self.GetChild("CommentBoard")
    		
    		self.scrollbar = ui.ScrollBarNewDesign()
    		self.scrollbar.SetParent(self.GetChild("Comment_GuildPage"))
    		self.scrollbar.SetPosition(342,14)
    		self.scrollbar.SetScrollBarSize(210)
    		self.scrollbar.SetScrollEvent(self.__OnScroll)
    		self.scrollbar.Show()
    		
    		self.commentSlot = ui.SpecialEditLine()
    		self.commentSlot.SetParent(self.GetChild("CommentBoard"))
    		self.commentSlot.SetPosition(220,16)
    		self.commentSlot.SetSize(121,25)
    		self.commentSlot.SetMax(35)
    		self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment)
    		self.commentSlot.SetIMEFlag(0)
    		self.commentSlot.SetPlaceHolderText("قم بكتابة الرسالة...")
    		self.commentSlot.SetPackedFontColor(0xffa07970)
    		self.commentSlot.Show()
    		
    		self.objPos = 0
    		self.scrollbar.SetPos(0)
    		self.LoadScroll()
    	#~~~~~~~ 3 Page
    	
    	def authority_guildPage(self):
    		textsAuthority = {1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_RASA,3 : uiScriptLocale.GUILD_MEMBER_LEVEL, 4 : uiScriptLocale.GUILD_MEMBER_SPECIFIC_GRAVITY,5 : uiScriptLocale.GUILD_MEMBER_RANK,}
    		self.players_Authority,u = {}, 0
    		for i in xrange(5):
    			self.players_Authority[i] = ui.TextLine()
    			self.players_Authority[i].SetParent(self.GetChild("Authority_Info_3"))
    			self.players_Authority[i].SetPosition(60+u,17)
    			self.players_Authority[i].SetText(textsAuthority[i+1])
    			self.players_Authority[i].SetFontColor(0.902, 0.816, 0.635)
    			self.players_Authority[i].Show()
    			if i == 0:
    				u += 60
    			elif i == 1 or i == 2:
    				u += 45
    			else:
    				u+= 60
    				
    		self.scrollbarAuthority = ui.ScrollBarNewDesign()
    		self.scrollbarAuthority.SetParent(self.GetChild("Authority_Info_2"))
    		self.scrollbarAuthority.SetPosition(344,15)
    		self.scrollbarAuthority.SetScrollBarSize(210)
    		self.scrollbarAuthority.SetScrollEvent(self.__OnScroll2)
    		# self.scrollbar.Show()
    		
    		self.objPos2 = 0
    		self.scrollbarAuthority.SetPos(0)
    		self.LoadScroll2()
    		pass
    
    	def LoadScroll2(self):
    		curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
    		pos = self.objPos2
    		if curMemberCount >= 5:
    			self.obj_count2 = 5
    			self.scrollbarAuthority.Show()
    		else:
    			self.obj_count2 = curMemberCount
    			self.scrollbarAuthority.Hide()
    		z=0
    
    		self.players, u = {}, 0
    		self.namesAuthority,self.imgs,self.levels,self.inverts,self.pos = {},{},{},{},{}
    
    		for i in xrange(self.obj_count2):
    			realPos = pos+i
    			
    			pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos)
    
    			if not name or name == "":
    				break
    				
    			guildExperienceSummary = guild.GetGuildExperienceSummary()
    
    			offerPercentage = 0
    			if guildExperienceSummary > 0:
    				offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)
    				
    			self.players[i] = ui.ImageBox()
    			self.players[i].SetParent(self.GetChild("Authority_Info_2"))
    			self.players[i].SetPosition(25,20+u)
    			self.players[i].LoadImage("d:/ymir work/interface/guild/dialog_member_slot.tga")
    			self.players[i].Show()
    			
    			self.pos[i] = ui.NewComboBox()
    			self.pos[i].SetParent(self.players[i])
    			self.pos[i].SetPosition(218,3)
    			self.pos[i].SetSize(90,23)
    			self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
    			masterName = guild.GetGuildMasterName()
    			mainCharacterName = player.GetMainCharacterName()
    			if mainCharacterName == masterName:
    				self.pos[i].Enable()
    				self.pos[i].SetEvent(lambda gradeNumber, lineIndex=realPos, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber))
    			self.pos[i].Show()
    	
    			self.pos[i].ClearItem()
    			for e in xrange(14):
    				self.pos[i].InsertItem(e+2, guild.GetGradeName(e+2))
    				self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
    
    			self.namesAuthority[i] = ui.TextLine()
    			self.namesAuthority[i].SetParent(self.players[i])
    			self.namesAuthority[i].SetPosition(50,7)
    			self.namesAuthority[i].SetText(name)
    			self.namesAuthority[i].SetFontColor(0.902, 0.816, 0.635)
    			self.namesAuthority[i].Show()
    			
    			self.imgs[i] = ui.ImageBox()
    			self.imgs[i].SetParent(self.players[i])
    			self.imgs[i].SetPosition(93,2)
    			self.imgs[i].LoadImage(FACE_IMAGE_DICT[race])
    			self.imgs[i].Show()
    			
    			self.levels[i] = ui.TextLine()
    			self.levels[i].SetParent(self.players[i])
    			self.levels[i].SetPosition(160,7)
    			self.levels[i].SetText(str(level))
    			self.levels[i].SetFontColor(0.424, 0.337, 0.329)
    			self.levels[i].Show()
    			
    			self.inverts[i] = ui.TextLine()
    			self.inverts[i].SetParent(self.players[i])
    			self.inverts[i].SetPosition(195,7)
    			self.inverts[i].SetText(str(offerPercentage)+"%")
    			self.inverts[i].SetFontColor(0.424, 0.337, 0.329)
    			self.inverts[i].Show()
    
    			u+= 30
    		
    	def __OnScroll2(self):
    		curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
    		self.objPos2 = self.scrollbarAuthority.GetPos() * (curMemberCount-6)
    		self.LoadScroll2()
    	
    	def OnChangeMemberGrade(self, id, gradeNumber):
    		PID = guild.MemberIndexToPID(id)
    		net.SendGuildChangeMemberGradePacket(PID, gradeNumber)
    		
    		self.objPos2 = 0
    		self.scrollbarAuthority.SetPos(0)
    		self.LoadScroll2()
    	
    	def RefAuthMember(self):
    		curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
    		if curMemberCount >= 5:
    			self.obj_count2 = 5
    		else:
    			self.obj_count2 = curMemberCount
    		pos = self.objPos2
    		
    		for i in xrange(self.obj_count2):
    			realPos = pos+i
    			pid, name, grade, race, level, offer, general = guild.GetMemberData(realPos)
    			if not name or name == "":
    				break
    				
    			guildExperienceSummary = guild.GetGuildExperienceSummary()
    
    			offerPercentage = 0
    			if guildExperienceSummary > 0:
    				offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)
    			if self.inverts[i] != 0:
    				self.inverts[i].SetText(str(offerPercentage)+"%")
    
    			self.pos[i].SetCurrentItem(guild.GetGradeName(grade))
    			
    			if self.pos[int(realPos)].CheckOpen() == 1:
    				self.open = 1
    				for e in xrange(self.obj_count2):
    					self.pos[e].Hide()
    				self.pos[int(realPos)].Show()
    				
    	def skill_guildPage(self):
    		self.skillPoints = self.GetChild("Skill_Plus_Value")
    		self.energy = self.GetChild("Dragon_God_Power_Value")
    		self.energyBar = self.GetChild("EnergyFull")
    		self.donate_energy = self.GetChild("DonateEnergyButton")
    		self.donate_energy.SetEvent(lambda : self.__OnOpenHealGSPBoard())
    		
    		
    		
    		self.backSlot = ui.GridSlotWindow()
    		self.backSlot.SetParent(self.GetChild("Skill_Page"))
    		self.backSlot.SetPosition(30-25,80)
    		self.backSlot.ArrangeSlot(210, 6, 1, 40, 40,3,0)
    		self.backSlot.SetSlotBaseImage("d:/ymir work/interface/slot/slot3.tga",1.0,1.0,1.0,1.0)
    		self.backSlot.SetWindowHorizontalAlignCenter()
    		self.backSlot.Show()
    		
    		self.activeSlot = ui.GridSlotWindow()
    		self.activeSlot.SetParent(self.GetChild("Skill_Page"))
    		self.activeSlot.SetPosition(34-25,84)
    		self.activeSlot.ArrangeSlot(210, 6, 1, 40, 40,3,0)
    		self.activeSlot.SetSlotBaseImage("d:/ymir work/ui/slot.tga",1.0,1.0,1.0,1.0)
    		self.activeSlot.SetWindowHorizontalAlignCenter()
    		self.activeSlot.Show()
    		
    		self.activeSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
    		self.activeSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type))
    		self.activeSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
    		self.activeSlot.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type))
    		self.activeSlot.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type))
    		self.activeSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
    		self.activeSlot.AppendSlotButton("d:/ymir work/interface/button/char_buttons/plus_01_normal.tga",\
    										"d:/ymir work/interface/button/char_buttons/plus_02_hover.tga",\
    										"d:/ymir work/interface/button/char_buttons/plus_03_active.tga")
    
    
    		## Active
    		for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):
    
    			slotIndex = self.activeSlot.GetStartIndex()+i
    			skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i]
    
    			self.activeSlot.SetSkillSlot(slotIndex, skillIndex, 0)
    			self.activeSlot.SetCoverButton(slotIndex)
    			self.activeSlot.RefreshSlot()
    			guild.SetSkillIndex(slotIndex, len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)+i)
    	
    	def RefreshGuildSkillPage(self):
    
    		if 0 != 0:
    			return
    
    		# page = self.pageDict["MUSIC"]
    
    		curPoint, maxPoint = guild.GetDragonPowerPoint()
    		maxPoint = max(maxPoint, 1)
    		self.energy.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+ "|cfff8d090 "  +str(curPoint) + " / " + str(maxPoint))
    
    		percentage = ( (float(curPoint / max(1, float(maxPoint))) * 100))
    		self.energyBar.SetPercentage(curPoint,maxPoint)
    
    		skillPoint = guild.GetGuildSkillPoint()
    		self.skillPoints.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS + "|cfff8d090 " +str(skillPoint))
    
    		# page.passiveSlot.HideAllSlotButton()
    		self.activeSlot.HideAllSlotButton()
    
    		## Active
    		for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):
    
    			slotIndex = self.activeSlot.GetStartIndex()+i
    			skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i]
    			skillLevel = guild.GetSkillLevel(slotIndex)
    			skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
    
    			self.activeSlot.SetSlotCount(slotIndex, skillLevel)
    
    			if skillLevel <= 0:
    				self.activeSlot.DisableCoverButton(slotIndex)
    			else:
    				self.activeSlot.EnableCoverButton(slotIndex)
    
    			if skillPoint > 0:
    				if skillLevel < skillMaxLevel:
    					self.activeSlot.ShowSlotButton(slotIndex)
    	
    	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 0 != 0:
    			return
    		# self.activeSlot = ui.GridSlotWindow()
    		if self.activeSlot.HasSlot(slotNumber):
    			self.activeSlot.SetSlotCoolTime(slotNumber, coolTime)
    
    	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):
    		self.tooltipSkill.HideToolTip()
    		self.tooltip_in = 0
    		
    	def SetSkillToolTip(self, tooltipSkill):
    		self.tooltipSkill = tooltipSkill
    	
    	def __OnOpenHealGSPBoard(self):
    
    		curPoint, maxPoint = guild.GetDragonPowerPoint()
    
    		if maxPoint - curPoint <= 0:
    			chat.AppendChat(1,localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE)
    			return
    
    		pickDialog = uiPickMoney_Guild.PickMoneyDialog_Guild()
    		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 grade_guildPage(self):
    		
    		textsGrade = {0 : "رقم.", 1 : uiScriptLocale.SELECT_NAME,2 : uiScriptLocale.GUILD_GRADE_PERMISSION_JOIN,3 : uiScriptLocale.GUILD_GRADE_PERMISSION_DELETE, 4 : uiScriptLocale.GUILD_GRADE_PERMISSION_NOTICE,5 : uiScriptLocale.GUILD_GRADE_PERMISSION_SKILL,}
    		self.players_t,u = {}, 0
    		for i in xrange(6):
    
    			self.players_t[i] = ui.TextLine()
    			self.players_t[i].SetParent(self.GetChild("Grade_Page"))
    			self.players_t[i].SetPosition(30+u,17)
    			self.players_t[i].SetText(textsGrade[i])
    			self.players_t[i].SetFontColor(0.902, 0.816, 0.635)
    			self.players_t[i].Show()
    			if i == 0:
    				u += 45
    			elif i == 1:
    				u += 65
    			elif i == 2:
    				u += 40
    			elif i == 3:
    				u+= 65
    			else:
    				u+= 45
    			
    		self.status11 = ui.NewBoard()
    		self.status11.SetParent(self.GetChild("Grade_Page"))
    		self.status11.SetSize(363,265)
    		self.status11.SetPosition(0,33+12)
    		self.status11.Show()
    
    		self.scrollbarGrade = ui.ScrollBarNewDesign()
    		self.scrollbarGrade.SetParent(self.status11)
    		self.scrollbarGrade.SetPosition(342,15)
    		self.scrollbarGrade.SetScrollBarSize(243)
    		self.scrollbarGrade.SetScrollEvent(self.__OnScroll3)
    		self.scrollbarGrade.Show()
    		
    		self.objPos3 = 0
    		self.scrollbarGrade.SetPos(0)
    		self.LoadScroll3()
    
    	def RefGradeGuild(self):
    		if 11 >= 9:
    			self.obj_count3 = 9
    		else:
    			self.obj_count3 = 13
    			
    		pos = self.objPos3
    		for i in xrange(1,self.obj_count3):
    			realPos = pos+i
    			name, authority = guild.GetGradeData(int(realPos))
    			
    			self.checkbox[i].SetCheck(authority & guild.AUTH_ADD_MEMBER)
    			self.checkbox4[i].SetCheck(authority & guild.AUTH_SKILL)
    			self.checkbox3[i].SetCheck(authority & guild.AUTH_NOTICE)
    			self.checkbox2[i].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
    			self.namesGrage[i].SetText(name)
    	
    	def LoadScroll3(self):
    		total = 13
    		
    		pos = self.objPos3
    		if total >= 9:
    			self.obj_count3 = 9
    		else:
    			self.obj_count3 = total
    		z=0
    		
    		self.img_rank, u = {}, 0
    		self.idx = {}
    		self.checkbox,self.checkbox2,self.checkbox3,self.checkbox4 = {},{},{},{}
    		self.namesGrage = {}
    
    		for i in xrange(1,self.obj_count3):
    			realPos = pos+i
    			
    			name, authority = guild.GetGradeData(int(realPos))
    			
    			self.img_rank[i] = ui.ExpandedImageBox()
    			self.img_rank[i].SetParent(self.status11)
    			self.img_rank[i].SetPosition(20,12+u)
    			self.img_rank[i].LoadImage("d:/ymir work/interface/guild/dialog_rank_slot.tga")
    			self.img_rank[i].Show()
    			
    			self.idx[i] = ui.TextLine()
    			self.idx[i].SetParent(self.img_rank[i])
    			self.idx[i].SetPosition(10,6)
    			self.idx[i].SetText(str(int(realPos))+".")
    			self.idx[i].SetPackedFontColor(0xffcaa76f)
    			self.idx[i].Show()
    			
    			self.namesGrage[i] = ui.EditableTextSlot(self.img_rank[i], 30, 2)
    			self.namesGrage[i].SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), i)
    			self.namesGrage[i].SetText(name)
    			self.namesGrage[i].Show()
    
    			event1 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
    			event2 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
    			event3 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
    			event4 = lambda argSelf=proxy(self), argIndex=int(realPos), argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
    			self.checkbox[i] = ui.CheckBox(self.img_rank[i],122,3,event1)
    			self.checkbox2[i] = ui.CheckBox(self.img_rank[i],173,3,event2)
    			self.checkbox3[i] = ui.CheckBox(self.img_rank[i],225,3,event3)
    			self.checkbox4[i] = ui.CheckBox(self.img_rank[i],275,3,event4)
    			
    			self.checkbox[i].SetCheck(authority & guild.AUTH_ADD_MEMBER)
    			self.checkbox4[i].SetCheck(authority & guild.AUTH_SKILL)
    			self.checkbox3[i].SetCheck(authority & guild.AUTH_NOTICE)
    			self.checkbox2[i].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
    			u += 30
    
    	def __OnScroll3(self):
    		self.objPos3 = self.scrollbarGrade.GetPos() * (14-10)
    		self.LoadScroll3()
    	
    	def OnCheckAuthority(self, argIndex, argAuthority):
    		name, authority = guild.GetGradeData(argIndex)
    		net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority)
    
    	def OnChangeGradeName(self, gradeNumber):
    		if len(gradeName) == 0:
    			gradeName = localeInfo.GUILD_DEFAULT_GRADE
    
    		net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName)
    		return TRUE
    		
    	def OnOpenChangeGradeName(self, arg):
    		self.cambiar = arg
    		self.a = uiCommon.InputDialog()
    		self.a.SetTitle("تغيير الرتبة")
    		self.a.SetAcceptEvent(ui.__mem_func__(self.__OnchangeName))
    		self.a.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog2))
    		self.a.Open()
    		
    	def __OnchangeName(self):
    		gradeName = self.a.GetText()
    		if len(gradeName) == 0:
    			gradeName = localeInfo.GUILD_DEFAULT_GRADE
    
    		net.SendGuildChangeGradeNamePacket(self.cambiar, gradeName)
    		self.__OnCloseQuestionDialog2()
    
    	def __OnCloseQuestionDialog2(self):
    		if self.a:
    			self.a.Close()
    		self.cambiar = None
    		self.a = None
    	
    	def OnUpdate(self):
    	#-1
    		self.mark.SetIndex(net.GetGuildID())
    		self.mark.SetScale(3.3)
    		self.guild_level.SetText(str(guild.GetGuildLevel()))
    		self.guild_name.SetText(guild.GetGuildName())
    		self.guild_leader.SetText(player.GetName())
    		curExp, lastExp = guild.GetGuildExperience()
    		curExp *= 100
    		lastExp *= 100
    		total = curExp + lastExp
    		self.exp_img.SetPercentage(curExp,total)
    		self.curr_exp.SetText("EXP:   "+str(curExp)+ "       " +uiScriptLocale.CHARACTER_FROM +"       "+str(total))
    		self.level_percent.SetText("%s %.2f%%" % ("", float(curExp) / max(1, float(total)) * 100))
    	#-1
    	#-2
    		curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
    		self.guild_members.SetText(str(curMemberCount)+" / "+str(maxMemberCount))
    		self.guild_members_level.SetText(str(guild.GetGuildMemberLevelAverage()))
    	#-2	
    	#-4
    	
    		self.RefAuthMember()
    	#-4
    	#-5
    		self.RefreshGuildSkillPage()
    	#-5
    	#-6
    		self.RefGradeGuild()
    		pass
    		
    	def Functie_glisare_max(self):
    		latime = self.GetChild("board").GetWidth()
    		latime2 = self.GetChild("TabButtonsBoard").GetWidth()
    		if latime < 467+48+39:
    			latime = latime+2
    			latime2 = latime2+2
    			self.SetSize(latime,300)
    			self.GetChild("board").SetSize(latime,340+10)
    			self.GetChild("TabButtonsBoard").SetSize(latime2,300+10)
    			self.GetChild("Authority_TitleBar").SetWidth(latime-15)
    			self.GetChild("Skill_TitleBar").SetWidth(latime-15)
    			self.GetChild("Grade_TitleBar").SetWidth(latime-15)
    			self.GetChild("Comment_TitleBar").SetWidth(latime-15)
    			self.GetChild("Info_TitleBar").SetWidth(latime-15)
    			self.GetChild("Expand").SetPosition(latime-15-70, 10)
    			self.GetChild("Minimize").SetPosition(latime-15-70, 10)
    			self.GetChild("TitleName").SetPosition(0, 12-172)
    			self.glisare = WaitingDialog()
    			self.glisare.Open(0.0)
    			self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_max)
    		else:
    			self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			if info_guildPage == 1:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    			if comment_guildPage == 1:
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			else:
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    			if authority_guildPage == 1:
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			else:
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    			if skill_guildPage == 1:
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			else:
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    			if grade_guildPage == 1:
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    			else:
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    			self.Button1Text.Show()
    			self.Button2Text.Show()
    			self.Button3Text.Show()
    			self.Button4Text.Show()
    			self.Button5Text.Show()
    			self.GetChild("Minimize").Show()
    			self.GetChild("Expand").Hide()
    
    	def Functie_glisare_min(self):
    		latime = self.GetChild("board").GetWidth()
    		latime2 = self.GetChild("TabButtonsBoard").GetWidth()
    		self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		if info_guildPage == 1:
    			self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		else:
    			self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if comment_guildPage == 1:
    			self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		else:
    			self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if authority_guildPage == 1:
    			self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		else:
    			self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if skill_guildPage == 1:
    			self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		else:
    			self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if grade_guildPage == 1:
    			self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		else:
    			self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		self.Button1Text.Hide()
    		self.Button2Text.Hide()
    		self.Button3Text.Hide()
    		self.Button4Text.Hide()
    		self.Button5Text.Hide()
    		if latime>340+47+39:
    			latime = latime-2
    			latime2 = latime2-2
    			self.SetSize(latime,300)
    			self.GetChild("board").SetSize(latime,340+10)
    			self.GetChild("TabButtonsBoard").SetSize(latime2,300+10)
    			self.GetChild("Authority_TitleBar").SetWidth(latime-15)
    			self.GetChild("Skill_TitleBar").SetWidth(latime-15)
    			self.GetChild("Grade_TitleBar").SetWidth(latime-15)
    			self.GetChild("Comment_TitleBar").SetWidth(latime-15)
    			self.GetChild("Info_TitleBar").SetWidth(latime-15)
    			self.GetChild("Expand").SetPosition(latime-15-70, 10)
    			self.GetChild("Minimize").SetPosition(latime-15-70, 10)
    			self.GetChild("TitleName").SetPosition(0, 12-172)
    			self.glisare = WaitingDialog()
    			self.glisare.Open(0.0)
    			self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_min)
    		else:
    			self.GetChild("Expand").Show()
    			self.GetChild("Minimize").Hide()
    			
    
    	def __BindEvent(self):
    		
    		for (tabKey, tabButton) in self.tabButtonDict.items():
    			tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey)
    			
    		for titleBarValue in self.titleBarDict.itervalues():
    			titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide))
    
    	def __LoadWindow(self):
    		if self.isLoaded == 1:
    			return
    
    		self.isLoaded = 1
    
    		try:
    			if localeInfo.IsARABIC() or localeInfo.IsVIETNAM() or localeInfo.IsJAPAN():
    				self.__LoadScript("uiscript/GuildWindow.py")
    			else:
    				self.__LoadScript("uiscript/GuildWindow.py")
    				
    			self.__BindObject()
    			self.__BindEvent()
    		except:
    			import exception
    			exception.Abort("OptionWindow.__LoadWindow")
    
    		self.SetState("INFO_GUILD")
    		
    
    	def Destroy(self):
    		self.ClearDictionary()
    		self.__Initialize()
    
    	def Close(self):
    		self.Hide()
    
    	def __OnClickTabButton(self, stateKey):
    		global info_guildPage,comment_guildPage,authority_guildPage,skill_guildPage,grade_guildPage
    		latime = self.GetWidth()
    		if stateKey == "INFO_GUILD":
    			info_guildPage = 1
    			comment_guildPage = 0
    			authority_guildPage = 0
    			skill_guildPage = 0
    			grade_guildPage = 0
    			if latime == 468+48+39:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.Button1Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_1)
    				self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2)
    				self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3)
    				self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4)
    				self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5)
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if stateKey == "COMMENT_PAGE":
    
    			info_guildPage = 0
    			comment_guildPage = 1
    			authority_guildPage = 0
    			skill_guildPage = 0
    			grade_guildPage = 0
    			if latime == 468+48+39:
    				net.SendGuildRefreshCommentsPacket(0)
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1)
    				self.Button2Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_2)
    				self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3)
    				self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4)
    				self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5)
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if stateKey == "AUTHORITY_PAGE":
    			info_guildPage = 0
    			comment_guildPage = 0
    			authority_guildPage = 1
    			skill_guildPage = 0
    			grade_guildPage = 0
    			if latime == 468+48+39:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1)
    				self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2)
    				self.Button3Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_3)
    				self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4)
    				self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5)
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if stateKey == "SKILL_PAGE":
    			info_guildPage = 0
    			comment_guildPage = 0
    			authority_guildPage = 0
    			skill_guildPage = 1
    			grade_guildPage = 0
    			if latime == 468+48+39:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1)
    				self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2)
    				self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3)
    				self.Button4Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_4)
    				self.Button5Text.SetText(uiScriptLocale.GUILD_PAGE_5)
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    		if stateKey == "GRADE_PAGE":
    			info_guildPage = 0
    			comment_guildPage = 0
    			authority_guildPage = 0
    			skill_guildPage = 0
    			grade_guildPage = 1
    			if latime == 468+48+39:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
    				self.Button1Text.SetText(uiScriptLocale.GUILD_PAGE_1)
    				self.Button2Text.SetText(uiScriptLocale.GUILD_PAGE_2)
    				self.Button3Text.SetText(uiScriptLocale.GUILD_PAGE_3)
    				self.Button4Text.SetText(uiScriptLocale.GUILD_PAGE_4)
    				self.Button5Text.SetText("|cfff8d090"+uiScriptLocale.GUILD_PAGE_5)
    				
    			else:
    				self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
    				self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
    		self.SetState(stateKey)
    
    	def SetState(self, stateKey):
    		self.state = stateKey
    
    		if constInfo.ENABLE_FIX_CHARACTER_PAGE:		
    			if stateKey == NAME_CLASS_I:
    				self.OnRefreshComments()
    
    		for (tabKey, tabButton) in self.tabButtonDict.items():
    			if stateKey!=tabKey:
    				tabButton.SetUp()
    
    		for pageValue in self.pageDict.itervalues():
    			pageValue.Hide()
    
    		for titleBarValue in self.titleBarDict.itervalues():
    			titleBarValue.Hide()
    
    		self.titleBarDict[stateKey].Show()
    		self.pageDict[stateKey].Show()
    		
    	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 OnPostComment(self):
    		text = self.commentSlot.GetText()
    		if not text:
    			return FALSE
    		if not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
    			chat.AppendChat(1,localeInfo.GUILD_NO_NOTICE_PERMISSION)
    			return
    
    		net.SendGuildPostCommentPacket(text[:50])
    		self.commentSlot.SetText("")
    		self.objPos = 0
    		self.scrollbar.SetPos(0)
    		self.LoadScroll()
    		return TRUE
    
    	def OnDeleteComment(self, index):
    		commentID, chrName, comment = self.__GetGuildBoardCommentData(index)
    		net.SendGuildDeleteCommentPacket(commentID)
    		self.LoadScroll()
    
    	def OnRefreshComments(self):
    		net.SendGuildRefreshCommentsPacket(0)
    
    	def __OnScroll(self):
    		self.OnRefreshComments()
    		self.objPos = self.scrollbar.GetPos() * (guild.GetGuildBoardCommentCount()-6)
    		self.LoadScroll()
    	
    	
    	def LoadScroll(self):
    		net.SendGuildRefreshCommentsPacket(0)
    		pos = self.objPos
    		if guild.GetGuildBoardCommentCount() >= 6:
    			self.obj_count = 6
    			self.scrollbar.Show()
    		else:
    			self.obj_count = guild.GetGuildBoardCommentCount()
    			self.scrollbar.Hide()
    		
    		self.delete,self.important, self.spaces,self.namesCommand,self.comments, u = {},{},{},{},{}, 0
    
    		for i in xrange(self.obj_count):
    			realPos = pos+i
    	
    			commentID, chrName, comment = self.__GetGuildBoardCommentData(realPos)
    			if chrName == "Noname":
    				break
    				
    			self.spaces[i] = ui.ImageBox()
    			self.spaces[i].SetParent(self.GetChild("Comment_GuildPage"))
    			self.spaces[i].SetPosition(20,20+u)
    			self.spaces[i].LoadImage("d:/ymir work/interface/guild/dialog_message_slot.tga")
    			self.spaces[i].Show()
    
    			self.namesCommand[i] = ui.TextLine()
    			self.namesCommand[i].SetParent(self.spaces[i])
    			self.namesCommand[i].SetPosition(50,8)
    			self.namesCommand[i].SetText(chrName)
    			self.namesCommand[i].SetPackedFontColor(0xffcaa76f)
    			self.namesCommand[i].Show()
    			
    			self.important[i] = ui.ImageBox()
    			self.important[i].SetParent(self.spaces[i])
    			self.important[i].SetPosition(87,8)
    			self.important[i].LoadImage("d:/ymir work/interface/guild/dialog_message_importantmsg.tga")
    		
    			self.comments[i] = ui.TextLine()
    			self.comments[i].SetParent(self.spaces[i])
    			self.comments[i].SetPosition(310,8)
    			if "!" == comment[0]:
    				self.comments[i].SetText(comment[1:])
    				self.comments[i].SetPackedFontColor(0xffdb9b93)
    				self.important[i].Show()
    			else:
    				self.comments[i].SetText(comment)
    				self.comments[i].SetPackedFontColor(0xffa08784)
    				
    			self.comments[i].Show()
    			
    			masterName = guild.GetGuildMasterName()
    			mainCharacterName = player.GetMainCharacterName()
    			
    			if mainCharacterName == chrName or (masterName == mainCharacterName):
    				self.delete[i] = ui.Button()
    				self.delete[i].SetParent(self.spaces[i])
    				self.delete[i].SetPosition(305,7)
    				self.delete[i].SetUpVisual("d:/ymir work/interface/guild/close_mini_01_normal.tga")
    				self.delete[i].SetOverVisual("d:/ymir work/interface/guild/close_mini_02_hover.tga")
    				self.delete[i].SetDownVisual("d:/ymir work/interface/guild/close_mini_03_active.tga")
    				self.delete[i].SetEvent(lambda x = realPos: self.OnDeleteComment(x))
    				self.delete[i].Show()
    		
    			u += 35
    	
    
    	def GetState(self):
    		return self.state
    		
    	def OnPressExitKey(self):
    		self.Close()
    		return TRUE
    	
    	def OnPressEscapeKey(self):
    		self.Close()
    		return TRUE
    
    
    class WaitingDialog(ui.ScriptWindow):
    	def __init__(self):
    		ui.ScriptWindow.__init__(self)
    		self.eventTimeOver = lambda *arg: None
    		self.eventExit = lambda *arg: None
    
    	def __del__(self):
    		ui.ScriptWindow.__del__(self)
    
    	def Open(self, waitTime):
    		import time
    		curTime = time.clock()
    		self.endTime = curTime + waitTime
    
    		self.Show()		
    
    	def Close(self):
    		self.Hide()
    
    	def Destroy(self):
    		self.Hide()
    
    	def SAFE_SetTimeOverEvent(self, event):
    		self.eventTimeOver = ui.__mem_func__(event)
    
    	def SAFE_SetExitEvent(self, event):
    		self.eventExit = ui.__mem_func__(event)
    		
    	def OnUpdate(self):
    		import time
    		lastTime = max(0, self.endTime - time.clock())
    		if 0 == lastTime:
    			self.Close()
    			self.eventTimeOver()
    		else:
    			return
    	def OnPressEscapeKey(self):
    		self.Close()
    		return TRUE
    		
    	def OnPressExitKey(self):
    		self.Close()
    		return TRUE
    

     


    Hey, imho it is this self.pos = ui.NewComboBox() class.
    Open your ui.py, look for the class NewComboBox() and set the position there.

    • Love 1
  9. 12 hours ago, Raylee said:

    ?

    You made my day ?

     

    It just sounds maybe a bit Cryptic.. but I am sure you cannot destroy something.

    Because you just "reserve" storage from your C:\ Drive so you can create a new "virtual" Drive which you will name D:\. 

     

    Otherwise:

    If you just have a C:\ Drive you can simple use a USB-Stick or an External Drive where you place your "ymir work" folder.

    I think if you just have one Hard disk which is called C:\ - every next Storage will be automaticly named as D:\ Hard disk.

    Otherwise you can manually change the Drive letter for your new devices.

     

     

    Best regards
    Raylee

    I almost died as well ? lulw

    You can mount your folder as a drive in Win. I took the first I found but at least it will show you the idea of how it works. Take a look 

    This is the hidden content, please

     

    • Metin2 Dev 2
    • Love 2
  10. 5 hours ago, mogulul said:

    Belive me,i also hate the new system...i want to try to open a server but a really old server....actually i wish to find a 34k source or to change 40k to 34k but i don t have enough knowledge about programming,i'm still learning


    And who forces you to do a server with all those features, guys? :D I mean.. you can use source and hide it all on the frontend if you do not like it. You can have an easily managable backend and just do it the way of your liking.  The way the core of "the good ol' game" works never changed as far as I know. Change my mind. :D

  11. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hi devs,

    I thought this tool might help to anybody who uses Eternexus or to people who sell their work to people who use it.

    Since Eternexus is case sensitive, all files within your packs that contain upper case letters will be ignored. With my tool you can simply rename all of them with one doubleclick.

    The tool is a simple Powershell script

    Get-ChildItem -Path $PSScriptRoot -Recurse | Where{ $_.Name -cne $_.Name.ToLower() } | ForEach-Object { $tn="$($_.Name)-temp"; $tfn="$($_.FullName)-temp"; $nn=$_.Name.ToLower(); Rename-Item -Path $_.FullName -NewName $tn; Rename-Item -Path $tfn -NewName $nn -Force;}

    compiled to .EXE for an easier usage. It was compiled with PS2EXE.

    Usage:
     

    Quote

    Simply put the .exe to any folder in that you need the case to be changed and double click it. Works recursively.



    Here is the 

    This is the hidden content, please
     & here is the 
    This is the hidden content, please

    • Metin2 Dev 3
    • Good 2
    • Love 10
  12. 14 minutes ago, ElRenardo said:

    I've been looking for this too some time ago and haven't found anything yet.

     

    First of all, I don't think those kind of textures are handmade but generated by 3ds max.

    Then maybe you don't even have to link the texture to the model, maybe it's already done when you tell 3ds max to create this texture for the model.

     

     


    That is exactly what I thought but I was just curious if there is a way to do it vice versa - to assign the texture and make it work the way it is supposed to work. Maybe @.plechito' knows more about this?

  13. On 1/20/2020 at 3:13 PM, SorinSmon said:

    Hello again metin2dev community.

    .gif

    in this video.. i have this notification for yes or no to be sure i sell what is want.. but i want to delete this function only for stones.. and more important to not appear this notification also if i select the button "sell" or how is on my video "vinde"

     

    (maybe can sound of waste of time.. but trust me guys.. is a big change for players.. because they need to select yes every time and if they sell idk 30 items + they will die :D )


    Hey man, to achieve what you want you will have to do some changes in uishop.py.

    Look for this piece of code
     

    itemName = item.GetItemName()
    
    questionDialog = uiCommon.QuestionDialog()
    questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount, itemPrice))
    		
    questionDialog.SetAcceptEvent(lambda arg1=attachedSlotPos, arg2=attachedCount, arg3 = itemtype: self.OnSellItem(arg1, arg2, arg3))
    questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
    questionDialog.Open()
    self.questionDialog = questionDialog

    and change it to something like this
     

    itemName = item.GetItemName()
    itemType = item.GetItemType()
    					
    if self.btnSell.IsDown() or item.ITEM_TYPE_METIN == itemType:
    	self.OnSellItem(attachedSlotPos, attachedCount, itemtype)
    else:
    	questionDialog = uiCommon.QuestionDialog()
    	questionDialog.SetText(localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount, itemPrice))
    		
    	questionDialog.SetAcceptEvent(lambda arg1=attachedSlotPos, arg2=attachedCount, arg3 = itemtype: self.OnSellItem(arg1, arg2, arg3))
    	questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
    	questionDialog.Open()
    	self.questionDialog = questionDialog


    I am not 100% sure this will work. It is not tested. Anyway this is the part you need to focus on.
    Hope this helps.

    Best regards!
    sndbn

     

    • Love 1
  14. 59 minutes ago, OtherChoice said:

    I'm not 100% sure but probably its managed on client source level with matrices of texture, depth stencyl, and such by Direct3d8


    I was wondering if it could be source related which I believe it partially is but still there has to be the 3D part of it because the exported model bears the information about the lighting map in it. Anyway, thanks a lot for the reply!

  15. Hey guys,

    because I do not know where to go for help anymore since even the autodesk community forum did not help me I have to ask here.

    Does anyone of you know how to apply the .dds lighting textures to an object using 3DS max? Or rather how is the ligting texture supposed to work in general?

    It's being used in many dungeons like demontower, enchanted forest, but even in the oldest ones like the ape dungeon.
    When you put these objects onto your map its lighting changes immediately. That is why there is differences (color)  between each one of the ape dungeons and I would love to reproduce it.

    Thx a lot for any tip!

    Best regards,

    Sandbone

  16. I did this almost two years ago without changing anything inside the game core and all was working just fine on a 1.2k players server. IDK. Changing the skill_proto in both client and server side plus replacing the .msa, .msk and .gr2 did it for me without any bugs. The only thing I was not able to reproduce was casting the skill aligned to the ground not to the middle of opponent's body which I cannot see in your release either. Good job anyway.

    • Sad 1
    • Lmao 1
×
×
  • 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.