Dieses system erlaubt es via neuem FB einen schmiedebonus zu skillen
Clientside könnt ihr selbst machen das der skill angezeigt wird da ich das nicht hier habe.
aber der rest vom script bitte schön
Was es bringt man kann via FB einen skill leveln bis auf level 8 was die uppchance aus der refine + den bonus des Skills zusammenrechnet
viel spaß
Spezial THX NOA. & Kimmi
LINK ZUM PIC:

Da unsere Files und Client eh im Umlauf sind haun wir das nun raus. danke NiiceOne.
EINBAU:
Game.py:
PHP Code:
"testx" : self.__testx,
"testxx" : self.__testxx,
"uppbutton" : self.__uppbutton,
def __testx(self, itemslot, itemtoup, kosten, chance, bonichance, type):
constInfo.wegwerfblock = 1
#net.SendChatPacket(str(itemslot) + " " + str(itemtoup) + " " + str(kosten) + " " + str(chance) + " " + str(type))
self.interface.OpenRefineNeu(itemslot, itemtoup, kosten, chance, bonichance, type)
def __testxx(self, uppitem, anzahl):
self.interface.AppendMaterialToRefineDialogNeu(uppitem, anzahl)
#net.SendChatPacket(str(uppitem) + " " + str(anzahl))
def __uppbutton(self, qid):
import constInfo
constInfo.uppbuttonqid = int(qid)
PHP Code:
wegwerfblock = 0
uppbuttonqid = 0
PHP Code:
def OpenRefineNeu(self, targetItemPos, nextGradeItemVnum, cost, prob, bonichance, type):
self.dlgschmied.Open(targetItemPos, nextGradeItemVnum, cost, prob, bonichance, type)
def AppendMaterialToRefineDialogNeu(self, vnum, count):
self.dlgschmied.AppendMaterial(vnum, count)
PHP Code:
class RefineNeu(ui.ScriptWindow):
def __init__(self):
ui.ScriptWindow.__init__(self)
self.__Initialize()
self.isLoaded = FALSE
def __Initialize(self):
self.dlgQuestion = None
self.children = []
self.vnum = 0
self.targetItemPos = 0
self.dialogHeight = 0
self.cost = 0
self.percentage = 0
self.type = 0
def __LoadScript(self):
try:
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/refinedialog.py")
except:
import exception
exception.Abort("RefineDialog.__LoadScript.LoadObject")
try:
self.board = self.GetChild("Board")
self.titleBar = self.GetChild("TitleBar")
self.probText = self.GetChild("SuccessPercentage")
self.costText = self.GetChild("Cost")
self.successPercentage = self.GetChild("SuccessPercentage")
self.GetChild("AcceptButton").SetEvent(self.OpenQuestionDialog)
self.GetChild("CancelButton").SetEvent(self.CancelRefine)
except:
import exception
exception.Abort("RefineDialog.__LoadScript.BindObject")
## 936 : °³·® È®·ü Ç¥½Ã ¾ÈÇÔ
##if 936 == app.GetDefaultCodePage():
self.successPercentage.Hide()
toolTip = uiToolTip.ItemToolTip()
toolTip.SetParent(self)
toolTip.SetFollow(FALSE)
toolTip.SetPosition(15, 38)
toolTip.Show()
self.toolTip = toolTip
self.slotList = []
for i in xrange(3):
slot = self.__MakeSlot()
slot.SetParent(toolTip)
slot.SetWindowVerticalAlignCenter()
self.slotList.append(slot)
itemImage = self.__MakeItemImage()
itemImage.SetParent(toolTip)
itemImage.SetWindowVerticalAlignCenter()
itemImage.SetPosition(-35, 0)
self.itemImage = itemImage
self.titleBar.SetCloseEvent(ui.__mem_func__(self.CancelRefine))
self.isLoaded = TRUE
def __del__(self):
ui.ScriptWindow.__del__(self)
def __MakeSlot(self):
slot = ui.ImageBox()
slot.LoadImage("d:/ymir work/ui/public/slot_base.sub")
slot.Show()
self.children.append(slot)
return slot
def __MakeItemImage(self):
itemImage = ui.ImageBox()
itemImage.Show()
self.children.append(itemImage)
return itemImage
def __MakeThinBoard(self):
thinBoard = ui.ThinBoard()
thinBoard.SetParent(self)
thinBoard.Show()
self.children.append(thinBoard)
return thinBoard
def Destroy(self):
self.ClearDictionary()
self.dlgQuestion = None
self.board = 0
self.probText = 0
self.costText = 0
self.titleBar = 0
self.toolTip = 0
self.successPercentage = None
self.slotList = []
self.children = []
def Open(self, targetItemPos, nextGradeItemVnum, cost, prob, bonichance, type):
if FALSE == self.isLoaded:
self.__LoadScript()
self.__Initialize()
self.targetItemPos = int(targetItemPos)
self.vnum = int(nextGradeItemVnum)
self.cost = str(cost)
self.percentage = str(prob)
self.type = str(type)
labelprob = "Verbesserungschance: " + str(prob) + "%" + " +Bonus: "+ str(bonichance) +"%"
labelcost = "Verbesserungskosten: " + str(cost) + " Yang"
self.probText.SetText("%s" % (labelprob))
self.probText.Show()
self.costText.SetText("%s" % (labelcost))
#self.probText.SetText(locale.REFINE_SUCCESS_PROBALITY % (self.percentage))
#self.costText.SetText(locale.REFINE_COST % (self.cost))
self.toolTip.ClearToolTip()
metinSlot = []
for i in xrange(player.METIN_SOCKET_MAX_NUM):
metinSlot.append(player.GetItemMetinSocket(int(targetItemPos), i))
attrSlot = []
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
attrSlot.append(player.GetItemAttribute(int(targetItemPos), i))
self.toolTip.AddRefineItemData(int(nextGradeItemVnum), metinSlot, attrSlot)
item.SelectItem(int(nextGradeItemVnum))
self.itemImage.LoadImage(item.GetIconImageFileName())
xSlotCount, ySlotCount = item.GetItemSize()
for slot in self.slotList:
slot.Hide()
for i in xrange(min(3, ySlotCount)):
self.slotList[i].SetPosition(-35, i*32 - (ySlotCount-1)*16)
self.slotList[i].Show()
self.dialogHeight = self.toolTip.GetHeight() + 46
self.UpdateDialog()
self.SetTop()
self.Show()
def Close(self):
constInfo.wegwerfblock = 0
self.dlgQuestion = None
self.Hide()
def AppendMaterial(self, vnum, count):
slot = self.__MakeSlot()
slot.SetParent(self)
slot.SetPosition(15, self.dialogHeight)
itemImage = self.__MakeItemImage()
itemImage.SetParent(slot)
item.SelectItem(int(vnum))
itemImage.LoadImage(item.GetIconImageFileName())
thinBoard = self.__MakeThinBoard()
thinBoard.SetPosition(50, self.dialogHeight)
thinBoard.SetSize(191, 20)
textLine = ui.TextLine()
textLine.SetParent(thinBoard)
textLine.SetFontName(locale.UI_DEF_FONT)
textLine.SetPackedFontColor(0xffdddddd)
textLine.SetText("%s x %02d" % (item.GetItemName(), int(count)))
textLine.SetOutline()
textLine.SetFeather(FALSE)
textLine.SetWindowVerticalAlignCenter()
textLine.SetVerticalAlignCenter()
if locale.IsARABIC():
(x,y) = textLine.GetTextSize()
textLine.SetPosition(x, 0)
else:
textLine.SetPosition(15, 0)
textLine.Show()
self.children.append(textLine)
self.dialogHeight += 40
self.UpdateDialog()
def UpdateDialog(self):
newWidth = self.toolTip.GetWidth() + 60
newHeight = self.dialogHeight + 69
## 936 : °³·® È®·ü Ç¥½Ã ¾ÈÇÔ
##if 936 == app.GetDefaultCodePage():
newHeight -= 8
if locale.IsARABIC():
self.board.SetPosition( newWidth, 0 )
(x, y) = self.titleBar.GetLocalPosition()
self.titleBar.SetPosition( newWidth - 15, y )
self.board.SetSize(newWidth, newHeight)
self.toolTip.SetPosition(15 + 35, 38)
self.titleBar.SetWidth(newWidth-15)
self.SetSize(newWidth, newHeight)
(x, y) = self.GetLocalPosition()
self.SetPosition(x, y)
def OpenQuestionDialog(self):
if 100 == self.percentage:
self.Accept()
return
if 5 == self.type: ## ¹«½ÅÀÇ Ãູ¼*
self.Accept()
return
dlgQuestion = uiCommon.QuestionDialog2()
dlgQuestion.SetText2(locale.REFINE_WARNING2)
dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.Accept))
dlgQuestion.SetCancelEvent(ui.__mem_func__(dlgQuestion.Close))
if 3 == self.type: ## Çöö
dlgQuestion.SetText1(locale.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_1)
dlgQuestion.SetText2(locale.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_2)
elif 2 == self.type: ## Ãູ¼*
dlgQuestion.SetText1(locale.REFINE_DOWN_GRADE_WARNING)
else:
dlgQuestion.SetText1(locale.REFINE_DESTROY_WARNING)
dlgQuestion.Open()
self.dlgQuestion = dlgQuestion
def Accept(self):
net.SendRefinePacket(255, 255)
import event
import constInfo
qid = constInfo.uppbuttonqid
event.QuestButtonClick(qid)
constInfo.uppbuttonqid = 0
self.Close()
def CancelRefine(self):
net.SendRefinePacket(255, 255)
self.Close()
def OnPressEscapeKey(self):
self.CancelRefine()
return TRUE
QUEST:
PHP Code:
-- config Zeile 36 / 41 & 68
quest goldener_schmied begin
state start begin
when login with pc.getqf("first_login") == 0 begin
mysql_query("INSERT INTO player.player_uppchance SET player_id='"..pc.get_player_id().."';")
chat("eintrag")
pc.setqf("first_login", 1)
end
when 70059.use begin
local skilllevel = pc.get_skill_level(120)
local chance_max = number(1, 100) -- zufall
local chance2 = 10 -- wert
if skilllevel < 7 then
if chance_max <= chance2 then -- falls wert größer als zufall
pc.set_skill_level(120, skilllevel +1)
syschat("Glückwünsch dein Training war erfolgreich!")
else
syschat("Du verstehst ein Teil des Buches jedoch nicht alles...")
end
item.remove()
elseif skilllevel == 7 then
if chance_max <= chance2 then -- falls wert größer als zufall
pc.set_skill_level(120, skilllevel +1)
syschat("Glückwünsch du hast diese Fertigkeit komplett erlernt!")
else
syschat("Du verstehst ein Teil des Buches jedoch nicht alles...")
end
item.remove()
else
syschat("Du kannt diese Fertigkeit nicht weiter erlernen.")
return
end
end
when 21900.chat."Items verbessern" begin
say_title("Goldener Schmied")
say("Hallo!")
say("Ich bin der neue Schmied auf Contract II.")
say("Meine Bewerbung für seinen Posten wurde")
say("angenommen als Ich hier meine Spezialitäten zeigte.")
say("Seit meinem Dasein gibt es zb. einen neuen Skill dieSchmiedekunst.")
say("Um so mehr du weißt über die Kunst des Schmiedens, desto höher die Chance des Erfolgs!")
say("Somit bin nun Ich für das Schmieden der")
say("Items verantwortlich. Wenn du etwas")
say("hast, was geschmiedet werden muss dann")
say("bring es zu mir!")
say_reward("Ziehe dafür das Item auf den Schmied.")
end
when 21900.chat."eintrag" begin
say_title("Goldener Schmied")
cmdchat("guildwarsearch xxx"..pc.getqf("fuckfuck").."")
pc.setqf("fuckfuck", pc.getqf("fuckfuck") +1)
end
-- wird kein item select gebraucht
when 21900.take begin
mituppitems = nil
mituppitems =in_tab(pc.get_map_index(),black_maps) and 1 or 0
if item.get_type() == 1 or item.get_type() == 2 then
save_item_id(item.get_id())
cmdchat("uppbutton "..q.getcurrentquestindex().."")
--syschat(""..q.getcurrentquestindex().."")
local stat,newt= item_stat(),{}
local prozent = stat[13] *1.10
local bonuschance = selectuppbonus(pc.get_skill_level(120))
local newchance = stat[14]
--chat(stat[1]..", "..stat[2]..", "..stat[3]..", "..stat[4]..", "..stat[5]..", "..stat[6]..", "..stat[7]..", "..stat[8]..", "..stat[9]..", "..stat[10]..", "..stat[11]..", "..stat[12]..", "..stat[13]..", "..stat[14])
--say("testx "..itemsize.." "..itemtoup.." "..uppitem0.." "..upitem0anzahl.." "..uppitem1.." "..upitem1anzahl.." "..uppitem2.." "..upitem2anzahl.." "..uppitem3.." "..upitem3anzahl.." "..uppitem4.." "..upitem4anzahl.." "..anzahluppitem.." "..kosten.." "..chance.."")
cmdchat("testx "..stat[1].." "..stat[2].." "..prozent.." "..newchance.." "..bonuschance.." 0")
if mituppitems == 1 then
if stat[3] > 0 then table.insert(newt,{stat[3],stat[8]}) cmdchat("testxx "..stat[3].." "..stat[8].."")end
if stat[4] > 0 then table.insert(newt,{stat[4],stat[9]}) cmdchat("testxx "..stat[4].." "..stat[9].."")end
if stat[5] > 0 then table.insert(newt,{stat[5],stat[10]}) cmdchat("testxx "..stat[5].." "..stat[10].."")end
if stat[6] > 0 then table.insert(newt,{stat[6],stat[11]}) cmdchat("testxx "..stat[6].." "..stat[11].."")end
if stat[7] > 0 then table.insert(newt,{stat[7],stat[12]}) cmdchat("testxx "..stat[7].." "..stat[12].."")end
end
table.save(newt,PATH_TO_QDBi)
end
end
when button or info begin
local item,id,dat= item_stat(),item_get_id(),table.load(PATH_TO_QDBi)
local prozent = item[13] *1.10
local bonuschance = selectuppbonus(pc.get_skill_level(120))
local newchance = bonuschance + item[14]
if not checkitem() then
syschat('Kein Item zum Uppen vorhanden')
return
end
if pc.get_money()< prozent then
syschat('Du hast nicht genug yang zum uppen')
return
end
if mituppitems == 1 then
for i=1,table.getn(dat) do
if pc.count_item(dat[i][1])<dat[i][2] then
syschat('Du hast nicht die richtigen Gegenstände zum Verbessern!.')
return
end
end
end
if not pc.enough_inventory(item[2]) then
syschat('Du hast nicht genug platz bei dir')
return
end
if number(1,100)<= newchance then
--syschat('Item erfolgreich geuppt')
cmdchat("sendrefineok")
uppover()
else
--syschat('Item uppen fehlgeschlagen')
cmdchat("sendrefinefail")
rem_id(id)
end
if mituppitems == 1 then
for i=1,table.getn(dat) do
pc.remove_item(dat[i][1],dat[i][2])
end
end
pc.change_gold(-prozent)
end
end
end
DB Tabelle : in die player damit:
Anhang






