htmltext_ini = "<html><head><title>Vote Reward NPC</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Char ***</color></center></td><td><center>*** Points ***</center></td></tr>"
con = L2DatabaseFactory.getInstance().getConnection()
pks = con.prepareStatement("SELECT COUNT('gived') FROM `hz_votes` WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"')) and gived = 0")
con = L2DatabaseFactory.getInstance().getConnection()
pks = con.prepareStatement("SELECT COUNT('gived') FROM `hz_votes` WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"')) and gived = 0")
rs = pks.executeQuery()
rs.next()
char_name = player.getName()
char_points = rs.getString("COUNT('gived')")
total_votes = int(char_points)
reward = total_votes * 10
if total_votes < 1 :
return "<html><body><center>" + player.getName() + " You dont have enough points go get reward!</center></body></html>"
else :
upd = con.prepareStatement("UPDATE `hz_votes` SET gived = 1 WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"'))")
upd.execute()
print str(player.getName()) + " have " + str(total_votes) + " point(s) so we gona give him " + str(reward) + " Festival Adena(s)"
GiveItem(int(Reward_ID),int(reward),player,npc)
htmltext_info = "<html><body><center><font color =\"FF00FF\"> Thanks for voting " + char_name + " <br>You win " + str(reward) + " Festival Adena</center></body></html>"
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Olá, seu tópico se encontra com um ou mais links offline. Caso ainda possua o conteúdo, favor postar aqui mesmo no tópico ou mandar MP para algum staff que estaremos normalizando o tópico.
Grato pela atenção!
Voce usar a conta de admin q vc tem no server, vai em accounts e define o acess_level la. e vc entra auto.
Eu tenho uma versão desse votesystem q tentei atualizar e com tutorial so acessar o link na minha assinatura em baixo.
eu tava com um projeto acis 398 mais o java era 11 ai nao sei atualizar e desistir fui olhar essa lucera, mal tem arquivos sobre ele entao eo projeto mais atual ?
se alguem tiver uma sourve/rev ja compilada boa fico a dispor no chat! meu intuito e aprender e tbm por online mais bem la na frente ai a 398 era limpa mais falaram que estava muito desatualizada e eu ia ter problema pra add qualquer coisa
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Pergunta
Vulto
Olá Galera eu quero aprender a editar Scripts, estou tentando Fazer um Vote Reward mas preciso editar um Script.
Eu quero entender cada comando. se alguem tiver um tutorial eu agradeço.
-------------------------------------------------------------------------------------------
import sys
import math
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
from net.sf.l2j import L2DatabaseFactory
from net.sf.l2j.gameserver.network.serverpackets import InventoryUpdate
from net.sf.l2j.gameserver.network.serverpackets import SystemMessage
from net.sf.l2j.gameserver.network import SystemMessageId
# ***************************************
# Setup script here..
# ***************************************
NPC = 50600
Reward_ID = 6673
Reward_Count= int(10)
QuestId = 50600
QuestName = "hzreward"
QuestDesc = "custom"
InitialHtml = "1.htm"
# ************************
# Dont Tuch Down!!
# ************************
def GiveItem(addItem, addCount, player, npc) :
iu = InventoryUpdate()
if addItem > 0 and addCount > 0 :
item = player.getInventory().addItem("Quest",int(addItem),int(addCount),player,npc)
iu.addItem(item)
player.sendPacket(iu)
sm = SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2)
sm.addItemName(item)
sm.addNumber(int(addCount))
player.sendPacket(sm)
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onTalk (self,npc,player):
return InitialHtml
def onAdvEvent (self,event,npc,player) :
htmltext = event
if event == "1" :
total_votes = 0
htmltext_ini = "<html><head><title>Vote Reward NPC</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Char ***</color></center></td><td><center>*** Points ***</center></td></tr>"
con = L2DatabaseFactory.getInstance().getConnection()
pks = con.prepareStatement("SELECT COUNT('gived') FROM `hz_votes` WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"')) and gived = 0")
rs = pks.executeQuery()
rs.next()
char_name = player.getName()
char_points = rs.getString("COUNT('gived')")
total_votes = int(char_points)
color_text = "<font color =\"00FFFF\">"
htmltext_info = "<tr><td><center><font color =\"FF00FF\">1</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_points + "</center></td></tr>"
htmltext_end = "</table><center><font color=\"FFFFFF\">" + "A Total of " + str(total_votes) + " vote's.<br><button value=\"Get Reward\" action=\"bypass -h Quest hzreward berewarded\" width=75 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></center></body></html>"
htmltext_list = htmltext_ini + htmltext_info + htmltext_end
con.close()
return htmltext_list
if event == "berewarded" :
con = L2DatabaseFactory.getInstance().getConnection()
pks = con.prepareStatement("SELECT COUNT('gived') FROM `hz_votes` WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"')) and gived = 0")
rs = pks.executeQuery()
rs.next()
char_name = player.getName()
char_points = rs.getString("COUNT('gived')")
total_votes = int(char_points)
reward = total_votes * 10
if total_votes < 1 :
return "<html><body><center>" + player.getName() + " You dont have enough points go get reward!</center></body></html>"
else :
upd = con.prepareStatement("UPDATE `hz_votes` SET gived = 1 WHERE `ip` = (SELECT `lastIP` FROM `accounts` WHERE `login` = (SELECT `account_name` FROM `characters` WHERE `char_name` = '"+player.getName()+"'))")
upd.execute()
print str(player.getName()) + " have " + str(total_votes) + " point(s) so we gona give him " + str(reward) + " Festival Adena(s)"
GiveItem(int(Reward_ID),int(reward),player,npc)
htmltext_info = "<html><body><center><font color =\"FF00FF\"> Thanks for voting " + char_name + " <br>You win " + str(reward) + " Festival Adena</center></body></html>"
con.close()
return htmltext_info
# *************************************************
# EOF
# *************************************************
QUEST = Quest(-1,QuestName,QuestDesc)
QUEST.addStartNpc(NPC)
QUEST.addTalkId(NPC)
print "Loaded: Vote Reward System [Powered by UnAfraid]"
----------------------------------------------------------------------------------------------
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts recomendados
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.