Unmantained Guida RELEASE mini pannello per vedere hp e mp dell'avversario!

Una guida contrassegnata come Unmantained contiene informazioni su un argomento obsoleto, non più utile o files non aggiornati da parte del creatore.
Stato
Discussione chiusa ad ulteriori risposte.

SkyHeart

Utente Electrum
14 Gennaio 2013
197
24
55
129
Ultima modifica da un moderatore:
pi-lbrxjxwgupeesjfuctcl.jpg




come mostra immagine sono qui per rilasciarvi un comodissimo pannello per sapere gli hp e mp dell'avversario che anche se grezzo lavorandoci su ne esce fuori un pannello per gestire i pvp... serve solo un po si python e fantasia :D

inserite in costinfo.py

Codice:
INPUT_IGNORE = 0


VID = 0
STHX = 0
HPXD = 0


PLAYER_HP = 0
PLAYER_MAX_HP = 0
PLAYER_SP = 0
PLAYER_MAX_SP = 0
PLAYER_NAME = ""


in game.py

Codice:
import uiHealth
            
            #wskaznikiHP
            "super_quest"                : self.Tabulejtor,
            "pvp_zdruwko"                : self.Mozart,
            
            #inputpowerdziwko
            "get_input_value"                : self.GetInputValue,
            "get_input_start"                : self.GetInputOn,
            "get_input_end"                    : self.GetInputOff,


def Mozart(self, data):
        dane = data.split("|")
        constInfo.PLAYER_NAME = str(dane[0])
        constInfo.PLAYER_HP = int(dane[1])
        constInfo.PLAYER_MAX_HP = int(dane[2])
        constInfo.PLAYER_SP = int(dane[3])
        constInfo.PLAYER_MAX_SP = int(dane[4])


def Tabulejtor(self, id):
        constInfo.STHX = int(id)
            
    def GetInputOn(self):
        constInfo.INPUT_IGNORE = 1
        
    def GetInputOff(self):
        constInfo.INPUT_IGNORE = 0
            
    def GetInputValue(self):
        net.SendQuestInputStringPacket(str(constInfo.VID))


def OpenQuestWindow(self, skin, idx):
        if constInfo.INPUT_IGNORE == 1:
            return
        else:
            self.interface.OpenQuestWindow(skin, idx)




in uitarget.py

Codice:
import uiHealth
import constInfo


def OnUpdate(self):        
        if player.IsPVPInstance(self.vid):
            constInfo.VID = self.vid
            event.QuestButtonClick(constInfo.STHX)
            if not self.healthBoard.IsShow() and self.vid != 0:
                self.healthBoard.Show()
        else:
            self.healthBoard.Hide()
        
        if self.isShowButton:
            
            exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE]
            distance = player.GetCharacterDistance(self.vid)


            if distance < 0:
                return


            if exchangeButton.IsShow():
                if distance > self.EXCHANGE_LIMIT_RANGE:
                    self.RefreshButton()


            else:
                if distance < self.EXCHANGE_LIMIT_RANGE:
                    self.RefreshButton()

sempre in uitarget cercate def __init__(self): e/o aggiungiete sotto
Codice:
        self.healthBoard = uiHealth.HealthBoard()

sotto def Close() aggiungiete

Codice:
        self.__Initialize()
        self.healthBoard.Hide()
        self.Hide()

ora create un file con nome uihealth.py e lo mettete in root e dentro scrivete

Codice:
#Krzywy
import ui
import constInfo


def GetInfoFrom(id):
    table = {
        1    :    constInfo.PLAYER_NAME,
        2    :    constInfo.PLAYER_HP,
        3    :    constInfo.PLAYER_MAX_HP,
        4    :    constInfo.PLAYER_SP,
        5    :    constInfo.PLAYER_MAX_SP}
        
    if table.has_key(id):
        return table[id]
        


class HealthBoard(ui.ThinBoard):


    def __init__(self):
        ui.ThinBoard.__init__(self)
        
        self.Config()


    def __del__(self):
        ui.ThinBoard.__del__(self)
        
    def Config(self):
        self.SetSize(200, 120)
        self.SetPosition(0, 20)
        
        self.hp_bar = ui.Gauge()
        self.hp_bar.SetParent(self)
        self.hp_bar.SetPosition(30, 30+20)
        self.hp_bar.MakeGauge(130, "red")
        self.hp_bar.Show()
        
        self.sp_bar = ui.Gauge()
        self.sp_bar.SetParent(self)
        self.sp_bar.SetPosition(30, 60+20)
        self.sp_bar.MakeGauge(130, "blue")
        self.sp_bar.Show()
        
        self.name = ui.TextLine()
        self.name.SetParent(self)
        self.name.SetDefaultFontName()
        self.name.SetPosition(45, 30)
        self.name.SetText("")
        self.name.Show()    
        
        self.hp_show = ui.TextLine()
        self.hp_show.SetParent(self)
        self.hp_show.SetDefaultFontName()
        self.hp_show.SetPosition(60-15, 57)
        self.hp_show.SetText("")
        self.hp_show.Show()    
        
        self.sp_show = ui.TextLine()
        self.sp_show.SetParent(self)
        self.sp_show.SetDefaultFontName()
        self.sp_show.SetPosition(60-15, 80+7)
        self.sp_show.SetText("")
        self.sp_show.Show()    
        
    def OnUpdate(self):
        if (GetInfoFrom(2)+GetInfoFrom(3)+GetInfoFrom(4)+GetInfoFrom(5)) == 0:
            self.Hide()
        self.hp_bar.SetPercentage(GetInfoFrom(2), GetInfoFrom(3))
        self.sp_bar.SetPercentage(GetInfoFrom(4), GetInfoFrom(5))
        self.name.SetText(GetInfoFrom(1))
        self.hp_show.SetText("Health Points: %s / %s" % (GetInfoFrom(2), GetInfoFrom(3)))
        self.sp_show.SetText("Mana Points: %s / %s" % (GetInfoFrom(4), GetInfoFrom(5)))
        self.name.SetText("Character: %s" % (GetInfoFrom(1)))

ed infine la quest
Codice:
-- Quest Opponents HP and MP during pvp
-- Made by: Endymion_
-- Server: Ascarial.pl
quest wskaznikHpWroga begin
    state start begin
        when login begin
            cmdchat("super_quest "..q.getcurrentquestindex())
        end


        when info or button begin
            cmdchat("get_input_start")
            local vid = input(cmdchat("get_input_value"))
            cmdchat("get_input_end")
            local old_pc = pc.select(vid)
            local name = pc.get_name()
            local hp = pc.get_hp()
            local max_hp = pc.get_max_hp()
            local mp = pc.get_sp()
            local max_mp = pc.get_max_sp()
            pc.select(old_pc)
            cmdchat("pvp_zdruwko "..name.."|"..hp.."|"..max_hp.."|"..mp.."|"..max_mp)
        end
    end
end



Fonti EPVP!!
 
Ultima modifica:
grazie mille, lo aggiungo al mio server. xD



non trovo "def__init__(self)" .. dove devo mettere i script?
 
Se qualcuno bravo con il python aggiunge tipo un bel tasto per annullare pvp e magari bloccare l'uso delle pozioni me lo dice in pvt o skype e ci facciamo una bella epic release :D
 
Se sapessi di fare circa 5k di penetrazione (esempio) e vedo che il mio avversario ha 4k di vita, andrei li e lo shotterei.

Quindi puoi dirmi le cose positive di questa release?
 
mhh che nessun privato lo ha ancora messo? e che quindi con un po di bravura in python ne esce qualcosa di esclusivo?
 
è una gran porcata.E fatta anche male.
Una cosa fatta bene(già fatta personalmente) è rendere visibili il tutto sotto il nome dei pg, e vedere le stat(hp ed mp) di tutti i pg.
In più dare la possibilità di nascondere le proprie stat tramite un apposito item(come fa il mantello del coraggio con il karma).

The only way to do something good is just use your brain .Copy and paste isn't right too.
 
A me non funziona e da questo errore:
1221 16:19:01500 :: CMapOutdoor::Load - LoadMonsterAreaInfo ERROR
1221 16:19:01980 :: GRANNY: r:/granny/rt/granny_file_info.cpp(145): File has run-time type tag of 0x8000000f, which doesn't match this version of Granny (0x80000010). Automatic conversion will be attempted.
1221 16:20:02823 :: CreateFromMemoryFile: Cannot create texture
1221 16:20:02943 :: CPythonBackground::GetFarClip m_eViewDistanceNum=0
1221 16:20:42511 ::
networkModule.py(line:194) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:27) ?
system.py(line:130) __pack_import


networkModule.SetSelectCharacterPhase - exceptions.SyntaxError:invalid syntax (line 48)


1221 16:20:42511 :: ============================================================================================================
1221 16:20:42511 :: Abort!!!!
 
Stato
Discussione chiusa ad ulteriori risposte.
Indietro
Top Bottom