Вот такой вариант ГС проходит, но на сервере не запускается почему то
import sys
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
from com.l2jserver.util import Rnd
from java.lang import System
from com.l2jserver.gameserver import Announcements
from com.l2jserver.gameserver.model import L2CharPosition
from com.l2jserver.gameserver.ai import CtrlIntention
MOBS = [18008,20830,21087,22123,22126,22132]
qn = "Attack_town"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def init_LoadGlobalData(self) :
self.startQuestTimer("gogogo", 600, None, None) #600000
return
def onAdvEvent (self,event,npc,player):
start = self.loadGlobalQuestVar("start")
if event == "gogogo":
Announcements.getInstance().announceToAll("Монстры напали на Гиран!")
self.startQuestTimer("first", 1000, None, None)
self.cancelQuestTimer("gogogo",None,None)
elif event == "first":
self.addSpawn(18008,80870,142381,-3545,40240,False,600000)
self.addSpawn(18008,81062,142356,-3558,40240,False,600000)
self.addSpawn(18008,81311,142389,-3580,40240,False,600000)
self.addSpawn(18008,80586,142520,-3544,40240,False,600000)
self.addSpawn(18008,80699,143015,-3539,40240,False,600000)
self.startQuestTimer("second", 90000, None, None)
self.cancelQuestTimer("first",None,None)
elif event == "second":
Announcements.getInstance().announceToAll("Монстры в Гиране!")
self.addSpawn(20830,81501,144672,-3532,40240,False,600000)
self.addSpawn(20830,81318,144467,-3532,40240,False,600000)
self.addSpawn(20830,81691,144601,-3532,40240,False,600000)
self.addSpawn(20830,81682,145161,-3532,40240,False,600000)
self.addSpawn(20830,81494,145410,-3532,40240,False,600000)
self.startQuestTimer("runners", 60000, None, None)
self.cancelQuestTimer("second",None,None)
elif event == "runners":
one = self.addSpawn(21087,84064,143774,-3404,40240,False,600000)
one.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(84043,146812, -3404, 0 ));
two = self.addSpawn(21087,83992,143770,-3404,40240,False,600000)
two.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(84083,146882, -3404, 0 ));
three = self.addSpawn(21087,83928,143864,-3404,40240,False,600000)
three.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(84013,146907, -3404, 0 ));
four = self.addSpawn(21087,83812,143816,-3404,40240,False,600000)
four.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(83963,146907, -3404, 0 ));
five = self.addSpawn(21087,83707,143796,-3404,40240,False,600000)
five.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(83944,146860, -3404, 0 ));
self.startQuestTimer("threee", 30000, None, None)
self.cancelQuestTimer("runners",None,None)
elif event == "threee":
Announcements.getInstance().announceToAll("Город захвачен!")
self.addSpawn(22123,84044,147687,-3397,40240,False,600000) #22122
self.addSpawn(22126,83876,147619,-3397,40240,False,600000)
self.addSpawn(22132,83645,147697,-3532,40240,False,600000)
self.addSpawn(22132,83321,147765,-3461,40240,False,600000)
self.addSpawn(22132,83147,147708,-3461,40240,False,600000)
self.addSpawn(22132,82326,148188,-3495,40240,False,600000)
self.addSpawn(22132,82292,148348,-3459,40240,False,600000)
self.addSpawn(22132,82586,148586,-3461,40240,False,600000)
self.startQuestTimer("fourr", 20000, None, None)
self.cancelQuestTimer("threee",None,None)
elif event == "fourr":
self.addSpawn(22123,82499,148781,-3461,40240,False,600000) #22122
self.addSpawn(22126,82649,148956,-3461,40240,False,600000)
self.addSpawn(18008,83042,149010,-3461,40240,False,600000)
self.addSpawn(18008,83337,148802,-3397,40240,False,600000)
self.addSpawn(18008,82942,148651,-3461,40240,False,600000)
self.addSpawn(18008,82260,148478,-3459,40240,False,600000)
self.addSpawn(18008,81795,148044,-3495,40240,False,600000)
self.addSpawn(18008,81891,147743,-3461,40240,False,600000)
self.startQuestTimer("fivee", 60000, None, None)
self.cancelQuestTimer("fourr",None,None)
elif event == "fivee":
Announcements.getInstance().announceToAll("Монстры уже в церкви!")
self.addSpawn(22123,84442,148621,-3428,40240,False,600000) #22122
self.addSpawn(22126,84440,148573,-3394,40240,False,600000)
self.addSpawn(18008,84428,148680,-3394,40240,False,600000)
self.addSpawn(22132,84534,148660,-3394,40240,False,600000)
self.addSpawn(22132,84521,148618,-3428,40240,False,600000)
self.addSpawn(18008,84511,148571,-3394,40240,False,600000)
self.startQuestTimer("boss", 10000, None, None)
self.cancelQuestTimer("fivee",None,None)
elif event == "boss":
self.addSpawn(29065,85980,148619,-3428,40240,False,600000)
self.cancelQuestTimer("boss",None,None)
return
def onKill(self,npc,player,isPet):
st = player.getQuestState("airin")
npcId = npc.getNpcId()
name = player.getName()
start = self.loadGlobalQuestVar("start")
if npcId == 29065 and start == "1":
Announcements.getInstance().announceToAll("Враг повержен! "+name+" это ты сделал это ")
Announcements.getInstance().announceToAll("Атака отбита")
st.giveItems(4037,100)
st.giveItems(4357,50)
elif npcId in MOBS and start == "1":
st.giveItems(4357,25)
return
QUEST = Quest(922,qn,"custom")
QUEST.addKillId(29065)
for i in MOBS:
QUEST.addKillId(i)