Jump to content
  • 0

[HELP]Couple of Script's Questions.


Question

Posted

  Hello, again me, sorry for make a new Topic but i think this will be much different from other. So i will say thank you to everybody who can and could help me in 2 questions what I have bout scripting (i just started do my first server 1,5 weeks before so dont laugh alotif I have some errors :D). ok here I come:

   

    1). First of all I would like to know how I can make my buffer remember and restore player's buff, I have a custom npc buffer but dont know how to make and option abous save/restore buffs.

    2). I was tryin to make a NPC who enchant your Armor, Weapon, Jewel and so on +30 (while server max enchant is +25) to improve donations from people so I've done the code, tell me why doesn't work and what do I do bad? :

import sys
from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from java.util import Iterator
from com.l2jserver	import L2DatabaseFactory
from com.l2jserver.gameserver.model.itemcontainer import Inventory
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest.jython import QuestJython as JQuest

qn= "99991_NpcEnchant"

NPC=[99991]
ADENA_ID=57

QuestId     = 99991
QuestName   = "NpcEnchant"
QuestDesc   = "custom"
InitialHtml = "1.htm"

print "ENCHANT NPC LOADED"

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)


def onEvent(self,event,st):
	htmltext = event

		#Helmet
	if event == "1":
		st.getPlayer().setTarget(st.getPlayer())
		ench = 30
		armorType = Inventory.PAPERDOLL_HEAD;
		st.setEnchant(activeTarget, ench, armorType);


QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

 

 

This is only for a Helmet but dont even work correctly :< "Your character dont ...blablalba... minimal quest requirements" = this.

Help me please and thanks all again!!

1 answer to this question

Recommended Posts

  • 0
Posted

1. You have to store players buff lists in database. You can check Rin4a Buffer - this is buffer with scheme system, language python.

 

2. My advice is, download eclipse and create new instance for your npc in - JAVA.

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...