Jump to content

Tasho

Banned
  • Posts

    358
  • Joined

  • Last visited

  • Days Won

    11
  • Feedback

    0%

Posts posted by Tasho

  1. I not understand very well what  you want but that should be.

    inputDay = raw_input("Put the days that you want to buy your car there: ")
    def rental_car_cost():
    
        if inputDay.isdigit():
            cost = int(inputDay) * 40
        
            if inputDay >= 7:
                print cost - 50
            elif inputDay >= 3:
                print cost - 20
            else:
                print 0 # something else
        else:
            print "The data type must be numbers integers."
            
    rental_car_cost()

    Here you can test it:

    https://goo.gl/GX6890

    Spoiler
    
    inputDay = raw_input("Put the days that you want to buy your car there: ")
    def rental_car_cost():
        if inputDay.isdigit():
            cost = int(inputDay) * 40
            if inputDay >= 7:
                return cost - 50
            elif inputDay >= 3:
                return cost - 20
            else:
                return 0 # something else
        else:
            return 0
            
    print rental_car_cost()

     

     

  2. https://youtu.be/28v78Jk9YZU?t=4s

    I think he speak about this system from Rubinum, but i dont know if is possible to do with lua (real time for all channels and select all players data) because there need to check all players from all channels and check them language if is en, de or if is global, and send it with special colors, block to send message etc. (like this screen, i find on patchlog of them)

    c8983fa3acee460f9a73677cd98acdc6.png=

    c17afb05c2ad43eca5cdd843415ba557.png

  3. PS: I didn't tested, but should working.

    • 1. Command mysql (if you want to reset for all people):
    UPDATE player.quest SET lValue = 0 WHERE szName LIKE ('%collect_quest_lv%') AND szState = 'duration';
    • 2. Quest (if you want for people can do that alone, you can put like via a special item etc):
    
    quest biolog begin
    	state start begin
    		function remove_time()
    			local biologistDict = {
    				"collect_quest_lv30", "collect_quest_lv40",
    				"collect_quest_lv50", "collect_quest_lv60",
    				"collect_quest_lv70", "collect_quest_lv80",
    				"collect_quest_lv85", "collect_quest_lv90",
    				"collect_quest_lv92", "collect_quest_lv94"
    			}
    
    			for questName = 1, table.getn(biologistDict) do
    				pc.setf(biologistDict[questName], "duration", 0) -- SetFlag(questName + "." + stateName, iValue);
    				syschat(string.format("pc.setf(%s.duration, 0)", biologistDict[questName]))
    			end
    		end
    		
    		when 20084.chat."Reset biologist time" begin
    			say_title("Biologist:")
    			say("Are you sure you want to do that?")
    			if (select("Yes", "Not now") == 1) then
    				biolog.remove_time()
    			end
    		end
    	end
    end

     

    • Love 1
  4. Then go and make a dbg on class where is opened for can be sure is called or is problem with your uiscript (some keys failed) and can't show and not all time show something on syserr.

    root/uiSystem.py (replace the function OpenDialog) with this:

    	def OpenDialog(self):
    		import chat
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "uiSystem.SystemDialog().OpenDialog()")
    		self.Show()

    If he show you message and not appear the window that means you have problem in ../SystemDialog.py (uiscript or locale)

    You can try also with:

    #self.Show()
    ui.ScriptWindow.Show(self)

     

  5. @danio475 Where is scope of break in this loop?

    You did a loop and check if not wear stop the loop without do nothing, so this loop not have sense.

    	return wear[i];

    You can't do that because "i" is not declared.

    Should look like this what you say.

    else if (GetWearFlag() & WEARABLE_UNIQUE)
    {
    	BYTE WEAR_EQ_LIST[4] = { 
    		WEAR_UNIQUE1,	WEAR_UNIQUE2, 
    		WEAR_UNIQUE3,	WEAR_UNIQUE4 
    	};
    
    	for (BYTE i=0; i<_countof(WEAR_EQ_LIST); i++)
    	{
    		BYTE bCell = WEAR_EQ_LIST[i];
    		if (!ch->GetWear(bCell))
    			return bCell;
    	}
    }

     

    • Love 1
  6. Try this. 

    #@root/uiInventory.py
    #Search for:
    	def OnPickMoney(self, money):
    		mouseModule.mouseController.AttachMoney(self, player.SLOT_TYPE_INVENTORY, money)
    #Add after:
    	def RefreshSlotAcce(self):
    		[self.wndEquip.SetItemSlot(item.COSTUME_SLOT_START + i, player.GetItemIndex(item.COSTUME_SLOT_START + i), 0) for i in xrange(item.COSTUME_SLOT_COUNT)]
    		self.wndEquip.RefreshSlot()
    		
    #Search in class InventoryWindow(ui.ScriptWindow):
    	def Show(self):
    		self.__LoadWindow()
    #Add after:
    		self.RefreshSlotAcce()
    
    #Search in def RefreshEquipSlotWindow(self):
    		self.wndEquip.RefreshSlot()
    #Add after:
    		self.RefreshSlotAcce()
    
    #@locale/xx/InventoryWindow.py
    #Search for:
                                "slot" : (
    #Add after:
    										{"index": item.COSTUME_SLOT_START + 2, "x": 80, "y": 3, "width":32, "height": 32},
  7. quest coins_for_kill begin 
        state start begin  
            when kill begin 
    			local mobVnum = npc.get_race()
    			local mobCoins = ({
    				[8024] = 30, -- 30 Coins
    				[8025] = 20 -- 20 Coins
    			})
    			[mobVnum]
    			
    			if not mobCoins then
    				return
    			end
    
    			pc.charge_cash(mobCoins, "coins_for_kill")
    			syschat(string.format("You get %d coins from %s.", mobCoins, mob_name(mobVnum)))
    		end 
    	end  
    end

    This is correctly quest rewrited.

    Already ymir did the function for lua to charge the coins via pc.charge_cash, but not all people was used because name of row is called: "cash" and they are used on website/itemshop etc row "coins", but can change very easy.

    Go in /src/db/ClientManager.cpp

    sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);

    Replace `cash` = `cash` with `coins` = `coins`

    • Love 1
  8. //Soure/Client/UserInterface/InstanceBaseEffect.cpp
    //Search for:
    	strDamageType = "target_";
    //Replace with:
    	strDamageType = (flag & DAMAGE_CRITICAL) ? "target_crit_" : "target_";
    • d:/ymir work/effect/affect/damagevalue/
    • This is the hidden content, please
      !VnROSw-OlAv1BT_DtavewoJ2EQn7PZBCeX6hL0Y36j8

    HPsOTcO.png

    dab3f9f046ba4f37a64ea58aaf228097.png

     

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

    If you know how make, tell me direct what to do.

     

    //Source/Client/InstanceBase.cpp
    Search and delete "//" from:
    	//rkEftMgr.CreateEffect(ms_adwCRCAffectEffect[EFFECT_DAMAGE_CRITICAL],v3Pos,v3Rot);

    Location effect:

    • d:/ymir work/effect/affect/damagevalue/critical.mse

    Download effect:

    Also is here:

     

  10. Hi there, I just came acorss a problem that I didnt figure out how to resolve and maybe you guys know something about it.

    I implemented on a new client a interface and it looks like this : 

    New client:

    166yv68.png

    if you look carefully you can see that there are 1px distance beteween the frames and the center.

    Old client:

    293a69x.png

    Here you can see that its all normal.

    The problem is somewhere in the client source, I tested with the old client launcher and it show the image normally.

    #Solved

    Problem was directx.

  11. Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

    	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
    	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
    		return FALSE;

    Also the check is already exist, just need to copy-paste check from:

    bool CInstanceBase::IsInSafe() // InstanceBase.cpp

    Original idea is from: Rubinum2.

    PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. ", you just copy also them idea and + title name video from rubinum.  i will release a code of mine "

    • Metin2 Dev 1
  12. 4 hours ago, PACI said:

    @Tasho, didn't get that for-loop.

    Yeah i know, was just for other shit things, sorry.

    • You can do it like this, without loop.
    	if selected then
    		[.......]
    	end
    • Or you can remove without check selected and without any loops.
    quest offline_message begin
        state start begin
            when 9006.chat."Select lang" with pc.getqf("selected") == 0 begin
    			say_title(mob_name(npc.get_race())..":")
    			say("")
    			local selected = select("Magyar", "English", "Deutsch")
    
    			pc.setqf("lang", selected)
    			pc.setqf("selected", 1)
    			say(translate[pc.getqf("lang")].offline_msg.notice)
    			end
    		end
    	end
    end

     

  13. 300+ lines for translate and exist 3 quests per language..omg.

    I will prefer much better something like this:

    translate[1].offline_msg = {}
    translate[1].offline_msg.notice = "Választott nyelv: Magyar!"
    
    translate[2].offline_msg = {}
    translate[2].offline_msg.notice = "Language selected: English!"
    
    translate[3].offline_msg = {}
    translate[3].offline_msg.notice = "Sprache gewählt: Deutsch!"

    And quest for select need to look like this:

    quest offline_message begin
        state start begin
            when 9006.chat."Select lang" with pc.getqf("selected") == 0 begin
                say_title(mob_name(npc.get_race())..":")
                say("")
                local selected = select("Magyar", "English", "Deutsch")
    
    			for key = 1, 3 do
    				if selected == key then
    					pc.setqf("lang", key)
    					pc.setqf("selected", 1)
    					say(translate[pc.getqf("lang")].offline_msg.notice)
    				end
    			end
    		end
    	end
    end

     

    And now you can call all with:

    • say(translate[pc.getqf("lang")].offline_msg.name)
×
×
  • 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.