
Pentru inceput adaugati asta in quest_functions
Cod: Selectaţi tot
pet.summon
pet.unsummon
pet.is_summonDeschidem folderul game.py si cautam :
Cod: Selectaţi tot
self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())Cod: Selectaţi tot
##START_PETGUI BY DASKUCHEN
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.PetName = ui.TextLine()
self.PetName.SetDefaultFontName()
self.PetName.SetPosition((wndMgr.GetScreenWidth()-460)+120, 35)
self.PetName.SetText("Haustierbesitzer: NONE")
self.PetName.SetOutline()
self.PetLevel = ui.TextLine()
self.PetLevel.SetDefaultFontName()
self.PetLevel.SetPosition((wndMgr.GetScreenWidth()-460)+120, 55)
self.PetLevel.SetText("Haustierlevel: NONE")
self.PetLevel.SetOutline()
self.PetBonus1 = ui.TextLine()
self.PetBonus1.SetDefaultFontName()
self.PetBonus1.SetPosition((wndMgr.GetScreenWidth()-460)+120, 75)
self.PetBonus1.SetText("1. Bonus: NONE")
self.PetBonus1.SetOutline()
self.PetBonus2 = ui.TextLine()
self.PetBonus2.SetDefaultFontName()
self.PetBonus2.SetPosition((wndMgr.GetScreenWidth()-460)+120, 95)
self.PetBonus2.SetText("2. Bonus: NONE")
self.PetBonus2.SetOutline()
self.PetBonus3 = ui.TextLine()
self.PetBonus3.SetDefaultFontName()
self.PetBonus3.SetPosition((wndMgr.GetScreenWidth()-460)+120, 115)
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)+65, 143)
self.PetExpLabel = ui.TextLine()
self.PetExpLabel.SetDefaultFontName()
self.PetExpLabel.SetPosition((wndMgr.GetScreenWidth()-460)+150, 140)
self.PetExpLabel.SetText("0%")
self.PetExpLabel.SetOutline()
##CLOSE_PETGUI BY DASKUCHEN Cod: Selectaţi tot
def __ServerCommand_Build(self):
serverCommandList={Cod: Selectaţi tot
##PETGUI BY DASKUCHEN
"ShowPetGui" : self.__showpetgui,
"HidePetGui" : self.__hidepetgui,
"HaustierName" : self.__PetName,
"HaustierLevel" : self.__PetLevel,
"HaustierBonus1" : self.__PetBoni1,
"HaustierBonus2" : self.__PetBoni2,
"HaustierBonus3" : self.__PetBoni3,
"PetProcentExp" : self.__PetExp,
## Cod: Selectaţi tot
def __hidepetgui(self):
self.PetGuiBg.Hide()
self.PetName.Hide()
self.PetLevel.Hide()
self.PetBonus1.Hide()
self.PetBonus2.Hide()
self.PetBonus3.Hide()
self.PetExpBar.Hide()
self.PetExpLabel.Hide()
def __showpetgui(self):
self.PetGuiBg.Show()
self.PetName.Show()
self.PetLevel.Show()
self.PetBonus1.Show()
self.PetBonus2.Show()
self.PetBonus3.Show()
self.PetExpBar.Show()
self.PetExpLabel.Show()
def __PetName(self, HaustierName):
self.PetName.SetText("Besitzer: " + HaustierName)
def __PetLevel(self, HaustierLevel):
self.PetLevel.SetText("Haustierlevel: " + HaustierLevel)
def __PetBoni1(self, HaustierBonus1):
self.PetBonus1.SetText("1. Bonus: " + HaustierBonus1 + " Angriffswert")
def __PetBoni2(self, HaustierBonus2):
self.PetBonus2.SetText("2. Bonus: " + HaustierBonus2 + " Verteidigung")
def __PetBoni3(self, HaustierBonus3):
self.PetBonus3.SetText("3. Bonus: " + HaustierBonus3 + " Lebenspunkte")
def __PetExp(self, PetProcentExp):
self.PetExpLabel.SetText(PetProcentExp + "%")
self.PetExpBar.SetPercentage(PetProcentExp, 100) Quest-uri
Se instaleaza in cd /usr/home/game/share/locale/romania(germany)/quest
Dupa intram in PUTTY Si scriem : cd /usr/home/game/share/locale/romania/quest
Dupa scriem : ./qc pet_system.quest
Cod: Selectaţi tot
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 )
horse.unsummon()
pc.setqf("petruf",0)
horse.set_level("21")
cmdchat("HidePetGui")
cleartimer("bugcheck")
end
when 53001.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
local Horselevel = 29-pc.getqf('petlevel')
horse.set_level(Horselevel)
horse.unsummon() horse.summon()
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
-- Bugschutz
when bugcheck.timer begin
if pc.count_item(53001) == 0 then
say_title("Buguser")
say("Bugusing festgestellt!")
pets.removebonus(pc.getqf('petlevel'))
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
endCod: Selectaţi tot
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 )
pet.unsummon()
pc.setqf("petruf",0)
horse.set_level("21")
cmdchat("HidePetGui")
cleartimer("bugcheck")
end
when 53001.use begin
horse.unride() horse.unsummon()
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
local Horselevel = 29-pc.getqf('petlevel')
horse.set_level(Horselevel)
pet.unsummon() pet.summon()
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
-- Bugschutz
when bugcheck.timer begin
if pc.count_item(53001) == 0 then
say_title("Buguser")
say("Bugusing festgestellt!")
pets.removebonus(pc.getqf('petlevel'))
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
endDowloand fisiere necesare :






