Hello Guys today i post this petgui design :D is not completed but you can edit it easy :) :D
First of all this is a photo:
[Only registered and activated users can see links. Click Here To Register...]
Now open game.py:
and find:
after this find this:
this is the quest:
First of all this is a photo:
[Only registered and activated users can see links. Click Here To Register...]
Now open game.py:
and find:
and down put this:Quote:
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
Quote:
##START_PETGUI BY KilleRzZ
PetGuiBg = ui.AniImageBox()
PetGuiBg.AddFlag("not_pick")
PetGuiBg.AppendImage("d:/ymir work/ui/petgui.dds")
self.PetGuiBg = PetGuiBg
self.PetGuiBg.SetPosition(wndMgr.GetScreenWidth()-460,0)
self.PetLevel = ui.TextLine()
self.PetLevel.SetDefaultFontName()
self.PetLevel.SetPosition((wndMgr.GetScreenWidth()-460)+90, 105)
self.PetLevel.SetText("Haustierlevel: NONE")
self.PetLevel.SetOutline()
self.PetBonus1 = ui.TextLine()
self.PetBonus1.SetDefaultFontName()
self.PetBonus1.SetPosition((wndMgr.GetScreenWidth( )-460)+145, 81)
self.PetBonus1.SetText("1.Bonus: NONE")
self.PetBonus1.SetOutline()
self.PetBonus2 = ui.TextLine()
self.PetBonus2.SetDefaultFontName()
self.PetBonus2.SetPosition((wndMgr.GetScreenWidth( )-460)+145, 95)
self.PetBonus2.SetText("2.Bonus: NONE")
self.PetBonus2.SetOutline()
self.PetBonus3 = ui.TextLine()
self.PetBonus3.SetDefaultFontName()
self.PetBonus3.SetPosition((wndMgr.GetScreenWidth( )-460)+145, 107)
self.PetBonus3.SetText("3.Bonus: NONE")
self.PetBonus3.SetOutline()
PetExpBar = ui.AniImageBox()
PetExpBar.AddFlag("not_pick")
PetExpBar.AppendImage("d:/ymir work/ui/pattern/charbar_main_yellow.tga")
PetExpBar.SetPercentage(0,1)
self.PetExpBar = PetExpBar
self.PetExpBar.SetPosition((wndMgr.GetScreenWidth( )-460)+120, 62)
self.PetExpLabel = ui.TextLine()
self.PetExpLabel.SetDefaultFontName()
self.PetExpLabel.SetPosition((wndMgr.GetScreenWidt h()-460)+180, 65)
self.PetExpLabel.SetText("0%")
self.PetExpLabel.SetOutline()
##CLOSE_PETGUI BY KilleRzZ
after this find this:
and down put this:Quote:
def __ServerCommand_Build(self):
serverCommandList={
and in the end of game.py put thisQuote:
##PETGUI BY KilleRzZ
"ShowPetGui" : self.__showpetgui,
"HidePetGui" : self.__hidepetgui,
"HaustierLevel" : self.__PetLevel,
"HaustierBonus1" : self.__PetBoni1,
"HaustierBonus2" : self.__PetBoni2,
"HaustierBonus3" : self.__PetBoni3,
"PetProcentExp" : self.__PetExp,
##
now you need to download this files:[Only registered and activated users can see links. Click Here To Register...].... and put it in your pack and put at your client index file name to like this:Quote:
def __PetLevel(self, HaustierLevel):
self.PetLevel.SetText(" " + HaustierLevel)
def __PetBoni1(self, HaustierBonus1):
self.PetBonus1.SetText(" " + HaustierBonus1 + " STR")
def __PetBoni2(self, HaustierBonus2):
self.PetBonus2.SetText(" " + HaustierBonus2 + " DEF")
def __PetBoni3(self, HaustierBonus3):
self.PetBonus3.SetText(" " + HaustierBonus3 + " HP")
def __PetExp(self, PetProcentExp):
self.PetExpLabel.SetText(PetProcentExp + "%")
self.PetExpBar.SetPercentage(PetProcentExp, 100)
We have end from client side! now server side (i have take the quest from DasKuchen and i have edit it)Quote:
Killerz
*
this is the quest:
(This system is not completed so dont be wicked) Thanks <3Quote:
quest pets begin
state start begin
function givebonus(x)
local y,boni = {53,54,1},pets.bonusliste()
table.foreach(boni[x],function(i,l) cmdchat("HaustierBonus"..i.." "..l.."") affect.add_collect(y[i],l,60*60*24*365*60) end )
cmdchat("HaustierLevel "..pc.getqf('petlevel').."")
cmdchat("HaustierName "..pc.get_name().."")
pc.setqf("petruf",1)
end
function bonusliste()
return {
[1] = {200,100,500},
[2] = {250,150,1000},
[3] = {300,200,1500},
[4] = {350,250,2000},
[5] = {400,300,3000},
}
end
function removebonus(x)
local y,boni = {53,54,1},pets.bonusliste()
table.foreach(boni[x],function(i,l) affect.remove_collect(y[i],l,60*60*24*365*60) end )
pc.setqf("petruf",0)
cmdchat("HidePetGui")
cleartimer("bugcheck")
end
when 53001.use or 53010.use or 53011.use or 53017.use or 53003.use or 53005.use or 53009.use or 53012.use or 53010.use or 53013.use or 53016.use begin
if pc.is_mount() then
say_title("Entschuldigung")
say("Bitte steige von deinem Mount ab!")
return
end
if pc.getqf('petlevel') == 0 then
pc.setqf('petlevel',1)
end
if pc.getqf("petruf") == 0 then
chat("Dein Haustier wurde gerufen.")
pets.givebonus(pc.getqf('petlevel'))
local expprocent1 = {20, 80, 160, 350, 400}
cmdchat("PetProcentExp "..(pc.getqf("exp")/expprocent1[pc.getqf("petlevel")]).."")
cmdchat("ShowPetGui")
loop_timer("bugcheck", 0.2)
elseif pc.getqf("petruf") == 1 then
pets.removebonus(pc.getqf('petlevel'))
chat("Dein Haustier verabschiedet sich nun.")
end
end
when kill with pc.getqf("petruf") == 1 begin
if pc.getqf("petlevel") == 5 then
return
end
if not npc.is_pc() then
pc.setqf("exp",pc.getqf("exp")+1)
local exp2up = {2000, 8000, 16000, 35000, 40000}
local expprocent = {20, 80, 160, 350, 400}
cmdchat("PetProcentExp "..(pc.getqf("exp")/expprocent[pc.getqf("petlevel")]).."")
if pc.getqf("exp") == exp2up[pc.getqf("petlevel")] then
if pc.getqf("petlevel") == 4 then
say_title("Herzlichen Glόckwunsch")
say("Dein Haustier erreicht Level "..(pc.getqf("petlevel")+1).."")
say_reward("Dies war das letzte Level!")
end
say_title("Herzlichen Glόckwunsch")
say("Dein Haustier erreicht Level "..(pc.getqf("petlevel")+1).."")
say("Rufe dein Pet bitte erneut!")
pc.setqf("petlevel",pc.getqf("petlevel")+1)
pc.setqf("exp",0)
pets.removebonus(pc.getqf('petlevel'))
end
end
end
when login or logout or disconnect with pc.getqf("petruf") == 1 begin
pets.removebonus(pc.getqf('petlevel'))
chat("Dein Haustier ist nicht mitgekommen...")
chat("Rufe es erneut!")
end
end
end