Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

System osiągnięć zliczanie punktów nad yangami


Rekomendowane odpowiedzi

Opublikowano

Cześć, dodałem sobie system osiągnięć, wszystko ładnie działa, zlicza punkty bez problemu

 

72076521086306990258.jpg

 

sklep również działa, lecz mam pytanie, dodałem sobie okienko na punkty nad yangami i teraz jest problem - nie wiem jak zrobić, aby te punkty wyświetlały się w tym okienku

 

83403508503714259761.jpg

 

Jakieś sugestie?

 

#EDIT 

Zauważyłem również, że gdy mam sklep za PO, to mimo tego, że mam wystarczającą ilość (np. 200 PO) i mam w sklepie item za 200 PO i tak nie mogę go kupić, ponieważ wyskakuje, że nie mam wystarczającej ilość "YANG"

 

to nie pomaga

[TAB][TAB][TAB]if shop.GetTabCoinType(0) == 0:
[TAB][TAB][TAB][TAB]self.tooltipItem.SetShopItem(slotIndex)
[TAB][TAB][TAB]else:
[TAB][TAB][TAB][TAB]self.tooltipItem.SetShopItemBySecondaryCoin(slotIndex)
Opublikowano

uiinventory:

[TAB][TAB][TAB]#self.wndMoney = self.GetChild("Money")
[TAB][TAB][TAB]self.wndAP = self.GetChild("AP")
[TAB]def RefreshStatus(self):
[TAB][TAB]self.wndAP.SetText("%s AP" % (str(constInfo.AP)))

Co do 2 to nie wiem, musiałbyś pokazać cały kod, możliwe że coś źle dodałeś. (Syserrr?)

Opublikowano

Niestety nie działa mi to co pokazałeś, pokażę tutaj wszystko co i jak mam dodane.

 

game.py

			"achievement"		: self.__AchievementTest,
			"Osiagniecia_Start"			: self.Osiagniecia_Start,		
			'setAP' : self.setAP,			
	def	Osiagniecia_Start(self, pkt):
		constInfo.AP = pkt

	def __ShowAchievementPoints(self, points):
		import uiAchievement
		import uiTaskbar
		self.uiAchievement = uiAchievement.AchievementDialog()
		uiAchievement.AchievementPoints = int(points)

	def __AchievementTest(self, archivement):
		import uiAchievement
		self.uiAchievement = uiAchievement.AchievementDialog()
		self.uiAchievement.Show(1, str(archivement))
		self.uiAchievement.SetTop() 

	def setAP(self, ap):
		constInfo.AP = ap
		self.interface.wndCharacter.RefreshStatus()
		

constinfo.py

AP = 0

uiinventory.py

			self.wndMoney = self.GetChild("Money")
			self.wndAP = self.GetChild("AP")	
	def RefreshStatus(self):
		money = player.GetElk()
		if money <= 100000000:
			self.wndMoney.SetFontColor(0.9, 0.9, 1.0)
		elif money >= 100000001 and money <= 1000000000:
			self.wndMoney.SetFontColor(1.0, 0.6, 0.2)
		elif money >= 1000000001 and money <= 1500000000:
			self.wndMoney.SetFontColor(1.0, 1.0, 0.2)
		elif money >= 1500000001:
			self.wndMoney.SetFontColor(0.6, 1.0, 0.2)
		self.wndMoney.SetText(localeInfo.NumberToMoneyString(money))
		self.wndAP.SetText("%s AP" % (str(constInfo.AP)))

inventorywindow.py

				{
					"name":"AP_Slot",
					"type":"button",

					"x":8,
					"y":53,

					"horizontal_align":"center",
					"vertical_align":"bottom",

					"default_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"over_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",
					"down_image" : "d:/ymir work/ui/public/parameter_slot_05.sub",

					"children" :
					(
						{
							"name":"AP_Icon",
							"type":"image",

							"x":-18,
							"y":2,

							"image":"d:/ymir work/ui/game/windows/money_icon.sub",
						},

						{
							"name" : "AP",
							"type" : "text",

							"x" : 3,
							"y" : 2,

							"horizontal_align" : "right",
							"text_horizontal_align" : "right",

							"text" : "123456789",
						},
					),
				},

w bince i source zrobione według poradnika Endymiona

Opublikowano

game:

"achievement" : self.__AchievementTest, 
"Osiagniecia_Start" : self.__ShowAchievementPoints,
 def __ShowAchievementPoints(self, points):
  import uiAchievement
  import uiTaskbar
  self.uiAchievement = uiAchievement.AchievementDialog()
  uiAchievement.AchievementPoints = int(points)
 
 def __AchievementTest(self, archivement):
  import uiAchievement
  self.uiAchievement = uiAchievement.AchievementDialog()
  self.uiAchievement.Show(1, str(archivement))
  self.uiAchievement.SetTop()

uiinventory:

def RefreshStatus(self):

import uiAchievement
self.uiAchievement = uiAchievement.AchievementDialog()
​self.wndAP.SetText("%s AP" % (str(uiAchievement.AchievementPoints)))

A to usuwasz:

'setAP' : self.setAP,
 
def Osiagniecia_Start(self, pkt):
constInfo.AP = pkt 
 
def setAP(self, ap):
constInfo.AP = ap self.interface.wndCharacter.RefreshStatus()
 
Opublikowano

Super, pokazuje mi AP w Ekwipunku tylko mam jeszcze parę pytań, jeśli możesz pomóc oczywiście.

 

Wziąłem sobie trochę plików odnośnie systemu osiągnięć z udostępnionych na MPCforum plików serwera Arianea i teraz tak

 

Quest wygląda następująco:

 

 

quest achieve_test begin
	state start begin
		when login begin
			cmdchat("staty "..(pc.getqf("friendlyEmpire")+pc.getqf("enemyEmpire")).." "..pc.getqf("bosses").." "..pc.getqf("metins").." "..pc.getqf("monsters").." "..((pc.getqf("friendlyEmpire")+pc.getqf("enemyEmpire"))+pc.getqf("bosses")+pc.getqf("metins")+pc.getqf("monsters")))
			-- cmdchat("staty 1 1 1 1 1")
			if pc.getqf("firstLogin") == 0 then
				pc.setqf("firstLogin", 1)
				givePoints("Pierwsze_Logowanie", 1)
			elseif pc.is_married() and pc.getqf("is_married") == 0 then
				pc.setqf("is_married", 1)
				givePoints("Zawarcie_Małżeństwa", 10)
			elseif !pc.is_married() and pc.getqf("is_married") == 1 then
				givePoints("Rozwód", 10)
				pc.setqf("is_married", 2)
			end
			cmdchat("Osiagniecia_Start "..pc.getqf("points"))
		end
		when success_fishing begin
			pc.setqf("successFishings", pc.getqf("successFishings")+1)
			if table_is_in({10, 100, 500, 1000}, pc.getqf("successFishings")) then
				local successFishingsTable =
				{
					[10] = 10,
					[100] = 25,
					[500] = 50,
					[1000] = 100,
				}
				givePoints("Poprawne_Złowienia:_"..pc.getqf("successFishings"), successFishingsTable[successFishings])
			end
		end
		when fail_fishing begin
			pc.setqf("failFishings", pc.getqf("failFishings")+1)
			if table_is_in({10, 100, 500, 1000}, pc.getqf("failFishings")) then
				local failFishingsTable =
				{
					[10] = 5,
					[100] = 15,
					[500] = 30,
					[1000] = 50,
				}
				givePoints("Złe_Złowienia:_"..pc.getqf("failFishings"), failFishingsTable[failFishings])
			end
		end
		when success_mining begin
			pc.setqf("successMinings", pc.getqf("successMinings")+1)
			if table_is_in({10, 100, 500, 1000}, pc.getqf("successMinings")) then
				local successMiningsTable =
				{
					[10] = 10,
					[100] = 25,
					[500] = 50,
					[1000] = 100,
				}
				givePoints("Poprawne_Wydobycia:_"..pc.getqf("successMinings"), successMiningsTable[successMinings])
			end
		end
		when fail_mining begin
			pc.setqf("failMinings", pc.getqf("failMinings")+1)
			if table_is_in({10, 100, 500, 1000}, pc.getqf("failMinings")) then
				local failMiningsTable =
				{
					[10] = 10,
					[100] = 25,
					[500] = 50,
					[1000] = 100,
				}
				givePoints("Złe_Wydobycia:_"..pc.getqf("failMinings"), failMiningsTable[failMinings])
			end
		end

		when kill begin
			if table_is_in({691, 791, 1304, 1901, 1091, 2091, 2206, 2191, 2307, 1093, 3290, 3291, 3490, 3491, 2598, 2597, 2591, 3090, 3091, 693,
			 3390, 3391, 3790, 3791, 1903, 2192, 7029, 3901, 3902, 3903, 7013, 2092, 2093, 6091, 
			 6191, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 80008, 8009, 8010, 8011, 8012, 8013, 8014, 8015, 8016, 8017, 8018, 
			 8024, 8025, 8026, 8027, 8036, 8053, 8038, 8040, 8039, 8037}, npc.get_race()) then
				local oT = 
				{
					[691] = 5,
					[791] = 5,
					[1304] = 5,
					[1901] = 5,
					[1091] = 5,
					[2091] = 5,
					[2206] = 25,
					[2191] = 5,
					[2307] = 5,
					[1093] = 15,
					[3290] = 15,
					[3291] = 15,
					[3490] = 15,
					[3491] = 15,
					[2598] = 25,
					[2597] = 20,
					[2591] = 15,
					[3090] = 20,
					[3091] = 20,
					[693]  = 50,
					[3390] = 20,
					[3391] = 20,
					[3790] = 25,
					[3791] = 25,
					[1903] = 50,
					[2192] = 50,
					[7029] = 25,
					[3901] = 25,
					[3902] = 25,
					[3903] = 25,
					[7013] = 40,
					[2092] = 40,
					[2093] = 25,
					[6091] = 100,
					[6191] = 100,
					[8001] = 5,
					[8002] = 5,
					[8003] = 5,
					[8004] = 5,
					[8005] = 5,
					[8006] = 5,
					[8007] = 5,
					[8008] = 5,
					[8009] = 5,
					[8010] = 5,
					[8011] = 5,
					[8012] = 5,
					[8013] = 5,
					[8014] = 30,
					[8015] = 4,
					[8016] = 4,
					[8017] = 4,
					[8018] = 4,
					[8024] = 5,
					[8025] = 5,
					[8026] = 5,
					[8027] = 5,
					[8036] = 10,
					[8053] = 15,
					[8038] = 15,
					[8040] = 15,
					[8039] = 20,
					[8037] = 25,
				}
				givePoints("Pokonano:_"..string.gsub(mob_name(npc.get_race()), " ", "_"), oT[npc.get_race()])
			end
			if npc.is_metin() then
				pc.setqf("metins", pc.getqf("metins")+1)
				local metins = pc.getqf("metins")
				if table_is_in({50, 100, 200, 500, 1000, 10000, 20000}, metins) then
					local metinsTable = 
					{
						[50] = 30,
						[100] = 60,
						[200] = 120,
						[500] = 240,
						[1000] = 480,
						[10000] = 700,
						[20000] = 1200,
					}
					givePoints("Pokonane_Metiny:_"..pc.getqf("metins"), metinsTable[metins])
				end
			elseif npc.is_boss() then
				pc.setqf("bosses", pc.getqf("bosses")+1)
				local bosses = pc.getqf("bosses")
				if table_is_in({50, 100, 200, 500, 1000, 10000, 20000}, bosses) then
					local bossesTable = 
					{
						[50] = 50,
						[100] = 100,
						[200] = 150,
						[500] = 200,
						[1000] = 400,
						[10000] = 1000,
						[20000] = 2000,
					}
					givePoints("Pokonane_Bossy:_"..pc.getqf("bosses"), bossesTable[bosses])
				end
			elseif !npc.is_pc() then
				pc.setqf("monsters", pc.getqf("monsters")+1)
				local monsters = pc.getqf("monsters")
				if table_is_in({1000, 10000, 50000, 100000, 500000, 1000000, 5000000, 10000000, 20000000}, monsters) then
					local monstersTable = 
					{
						[1000] = 5,
						[10000] = 15,
						[50000] = 50,
						[100000] = 100,
						[500000] = 150,
						[1000000] = 200,
						[5000000] = 400,
						[10000000] = 600,
						[20000000] = 1000,
					}
					givePoints("Zabite_Potwory:_"..pc.getqf("monsters"), monstersTable[monsters])
				end
			elseif npc.is_pc() then
				if npc.get_empire() == pc.empire and npc.get_level()+40 >= pc.level then
					pc.setqf("friendlyEmpire", pc.getqf("friendlyEmpire")+1)
					local friendlyEmpire = pc.getqf("friendlyEmpire")
					if table_is_in({100, 200, 500, 1000, 10000, 15000, 20000, 25000}, friendlyEmpire) then
						local friendlyEmpireTable =
						{
							[100] = 10,
							[200] = 20,
							[500] = 50,
							[1000] = 100,
							[10000] = 250,
							[15000] = 350,
							[20000] = 450,
							[25000] = 550,
						}
						givePoints("Zabójstwa_Przyjaznych_Graczy:_"..pc.getqf("friendlyEmpire"), friendlyEmpireTable[friendlyEmpire])
					end
				elseif npc.get_empire() != pc.empire and npc.get_level()+40 >= pc.level then
					pc.setqf("enemyEmpire", pc.getqf("enemyEmpire")+1)
					local enemyEmpire = pc.getqf("enemyEmpire")
					if table_is_in({100, 200, 500, 1000, 10000, 15000, 20000, 25000}, enemyEmpire) then
						local enemyEmpireTable =
						{
							[100] = 10,
							[200] = 20,
							[500] = 50,
							[1000] = 100,
							[10000] = 250,
							[15000] = 350,
							[20000] = 450,
							[25000] = 550,
						}
						givePoints("Zabójstwa_Wrogich_Graczy:_"..pc.getqf("enemyEmpire"), enemyEmpireTable[enemyEmpire])
					end
				end
			end
			cmdchat("staty "..(pc.getqf("friendlyEmpire")+pc.getqf("enemyEmpire")).." "..pc.getqf("bosses").." "..pc.getqf("metins").." "..pc.getqf("monsters").." "..((pc.getqf("friendlyEmpire")+pc.getqf("enemyEmpire"))+pc.getqf("bosses")+pc.getqf("metins")+pc.getqf("monsters")))
		end
		when levelup with table_is_in({50, 75, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200}, pc.level) begin
			local levelupTable = 
			{
				[50] = 5,
				[75] = 10,
				[90] = 15,
				[100] = 30,
				[110] = 45,
				[120] = 60,
				[130] = 75,
				[140] = 90,
				[150] = 110,
				[160] = 130,
				[170] = 150,
				[180] = 200,
				[190] = 300,
				[200] = 450,
			}
			givePoints("Awans:_"..pc.level, levelupTable[pc.level])
		end
		when success_refine begin
			if pc.getf("qf", "lastRefinedLevel") != 8 then
				return
			end
			pc.setqf("successRefineOn9", pc.getqf("successRefineOn9")+1)
			local refineS = pc.getqf("successRefineOn9")
			if table_is_in({1, 5, 10, 20}, refineS) then
				local refineSTable =
				{
					[1] = 10,
					[5] = 20,
					[10] = 30,
					[20] = 50,
				}
				givePoints("Poprawne_Ulepszenia+9:_"..pc.getqf("successRefineOn9"), refineSTable[refineS])
			end
		end
		when fail_refine begin
			if pc.getf("qf", "lastRefinedLevel") != 8 then
				return
			end
			pc.setqf("failRefineOn9", pc.getqf("failRefineOn9")+1)
			local refineS = pc.getqf("failRefineOn9")
			if table_is_in({1, 5, 10, 20}, refineF) then
				local refineFTable =
				{
					[1] = 10,
					[5] = 20,
					[10] = 30,
					[20] = 50,
				}
				givePoints("Niepoprawne_Ulepszenia+9:_"..pc.getqf("failRefineOn9"), refineFTable[refineF])
			end
		end
	end
end

 

 

 

achievement_lua

 

 

achiev_name = {}
achiev_name.boss_kill 	=	"Zagłada Wielkich"
achiev_name.metin_destroy	=	"Kamienie Metin"
achiev_name.mob_kill		=	"Zagłada"
achiev_name.pc_kill_enemy	=	"Za Cesarza!"
achiev_name.pc_kill_peace	=	"Niewinni gin?pierwsi"
achiev_name.achiev_yang_1	=	"Milioner"
achiev_name.achiev_yang_2	=	"Bank rozbity"
achiev_name.dt_up	=	"Windą byłoby szybciej"
achiev_name.dt_elevator	=	"Szybka Winda"
achiev_name.level_30	=	"Pocz?uj? Gracz"
achiev_name.level_75	=	"Pierwsze koty za płoty"
achiev_name.level_110	=	"Exp Dominator"
achiev_name.level_135	=	"Mistrz Arianei"
achiev_name.have_guild	=	"Ja tu rządze!"
achiev_name.have_guild_land	=	"Włsne cztery kąty"
achiev_name.have_guild_lv5	=	"Grupa zorgranizowana"
achiev_name.have_guild_lv10	=	"Stowarzyszenie"
achiev_name.have_guild_lv20	=	"Gildia Mistrzów"
achiev_name.wedding			=	"Zakochana para"
achiev_name.kon_zwykly	=	"Własny rumak"
achiev_name.kon_bojowy	=	"Bojowa Szkapa"
achiev_name.kon_militarny	=	"Czołg na czterech nogach"
achiev_name.ranga_rycerski	=	"Rycerz w lśniącej zbroi"
achiev_name.ranga_okrutny	=	"Brudny Harry"
achiev_name.arena_complete	=	"?yje i mam si?dobrze"
achiev_name.arena_complete_3	=	"O trzech takich co poszli na arene"
achiev_name.arena_complete_6	=	"W kupie si?ła"
achiev_name.arena_drop_box	=	"Znalezione, niekradzione!"

 

 

 

questlib

 

 

dofile("/usr/home/mt2/share/locale/poland/quest/achievement.lua")
function givePoints(awardName, points)
	pc.setf("system_osiagniec", "points", pc.getf("system_osiagniec", "points")+points)
	cmdchat("achievement "..awardName.."%"..points.."_("..pc.getf("system_osiagniec", "points")..")")
	chat(chat_color("[Osiągnięcie]", "blue").." Udało Ci się zdobyć osięgnięcie: '"..string.gsub(awardName, "_", " ").."', otrzymujesz "..points.." PO (Wszystkie: "..pc.getf("system_osiagniec", "points")..")")
end

 

 

 

Wszystko śmiga, wygląda to następująco

 

61766676265599393878.jpg

 

38771173670532080994.jpg

 

Jak zrobić aby wyświetlało się tylko to co jest w nawiasie, czyli suma wszystkich PO, a nie zdobyte, a w nawiasie wszystkie? (chodzi mi tylko o pole w ekwipunku)

 

+ nadal mam problem z tym

 

74006950771061178214.jpg

 

26305527117882325064.jpg

Opublikowano

teraz jest dobrze jak się zaloguję, pokazuje normalną ilość punktów

 

96605802218776328534.jpg

 

lecz jak wykonam jakieś osiągnięcie

 

19164448351494453351.jpg

 

po teleporcie ta "5" znika i zostaje samo 286, lecz niestety jak coś zrobię to nawias się pojawia

Opublikowano

okej, doszedłem w sumie do tego, jest teraz okej, tylko okienko na dole po prawo mi się nie wyświetla, co w sumie nie jest mi potrzebne, ostatnie pytanie związane z tym, że mimo tego, że mam wystarczającą ilość PO to nie mogę i tak nic kupić, oraz komunikat wyświetla informacje o braku YANG a nie PO

Opublikowano

Jak masz sklepy od Endiego to

ch->GetQuestFlag("achiev.points");

zmieniasz na

ch->GetQuestFlag("system_osiagniec");

Nie wiem co innego może być źle.

Opublikowano

próbowałem 

ch->GetQuestFlag("system_osiagniec");

oraz

ch->GetQuestFlag("points");

niestety dalej nie działa, może to być problem z tym, że w queście jest nadawane 

setf

zamiast

setqf

?

 

#EDIT

 

to ukazuje się w Quest w MySQL

 

08794288064568377201.jpg

Opublikowano

świetnie, działa, bardzo dziękuję, ostatnie 3 pytania

 

Jak zrobić aby po kupnie czegoś punkty w ekwipunku się odświeżały? (odświeżają się dopiero gdy się przeloguję)

 

Jak zrobić aby wyskakiwał komunikat, że nie mam wystarczającej liczby PO, a nie yang?

 

Jak zrobić aby przy kupowaniu wyskakiwał komunikat czy chcę kupić ten przedmiot i wybór Tak, Nie?

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...