当前位置: 首页>>代码示例>>Python>>正文


Python quest.State类代码示例

本文整理汇总了Python中com.l2jfrozen.gameserver.model.quest.State的典型用法代码示例。如果您正苦于以下问题:Python State类的具体用法?Python State怎么用?Python State使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了State类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self,id,name,descr):
     JQuest.__init__(self,id,name,descr)
     # All of these are overridden in the subclasses
     self.NPC = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     self.Items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
     self.Mob = [0, 1, 2]
     self.classid = 0
     self.prevclass = 0
     self.qn = "SagasSuperclass"
     self.X = [0, 1, 2]
     self.Y = [0, 1, 2]
     self.Z = [0, 1, 2]
     self.Text = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
     self.Spawn_List = []
     #all these are not overridden by the subclasses (either cause they are constant or used only for this script)
     self.CREATED     = State('Start', self)
     self.STARTED     = State('Started', self)
     self.COMPLETED   = State('Completed', self)
开发者ID:eskruolis,项目名称:la2hardcore,代码行数:18,代码来源:__init__.py

示例2: onKill

 def onKill(self,npc,player,isPet):
   st = player.getQuestState(qn)
   if not st : return 
   if st.getState() != STARTED : return 
   
   npcId = npc.getNpcId()
   if npcId == GEMSTONE_BEAST and st.getInt("cond")==5 and st.getRandom(2)==1 and st.getQuestItemsCount(GEMSTONE_BEAST_CRYSTAL)<10 :
        st.giveItems(GEMSTONE_BEAST_CRYSTAL,1)
        if st.getQuestItemsCount(GEMSTONE_BEAST_CRYSTAL) == 10 :
            st.playSound("ItemSound.quest_middle")
        else:
            st.playSound("ItemSound.quest_itemget")
   return

QUEST       = Quest(347,qn,"Calculator")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)


QUEST.setInitialState(CREATED)
QUEST.addStartNpc(BRUNON)

QUEST.addTalkId(BRUNON)

QUEST.addTalkId(SILVERA)
QUEST.addTalkId(SPIRON)
QUEST.addTalkId(BALANKI)

QUEST.addKillId(GEMSTONE_BEAST)
STARTED.addQuestDrop(GEMSTONE_BEAST, GEMSTONE_BEAST_CRYSTAL, 1)
开发者ID:eskruolis,项目名称:la2hardcore,代码行数:31,代码来源:__init__.py

示例3: Quest

   htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
   st = player.getQuestState(qn)
   if not st : return htmltext
   npcId = npc.getNpcId()
   id = st.getState()
   cond = st.getInt("cond")
   if npcId == LIESEL and cond == 0 :
     if id == COMPLETED :
       htmltext = "<html><body>This quest has already been completed.</body></html>"
     elif player.getLevel() < 74 : 
       htmltext = "31263-1.htm"
       st.exitQuest(1)
     elif player.getLevel() >= 74 : 
       htmltext = "31263-0.htm"
   elif npcId == LIESEL and cond == 1 :
     htmltext = "31263-2.htm"
   elif npcId == GHOST_OF_ADVENTURER and cond == 1 and id == STARTED:
     htmltext = "31538-0.htm"
   return htmltext

QUEST       = Quest(14,qn,"Whereabouts Of The Archaeologist")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(LIESEL)
QUEST.addTalkId(LIESEL)
QUEST.addTalkId(GHOST_OF_ADVENTURER)

STARTED.addQuestDrop(GHOST_OF_ADVENTURER,LETTER,1)
开发者ID:eskruolis,项目名称:la2hardcore,代码行数:31,代码来源:__init__.py

示例4: divmod

      if not st : return
      count = st.getQuestItemsCount(VACUALITE_ORE)
      if st.getInt("cond") == 2 and count < 50 :
         chance = CHANCE_FOR_QUEST_ITEMS * Config.RATE_DROP_QUEST
         numItems, chance = divmod(chance,100)
         if st.getRandom(100) < chance : 
            numItems += 1
         if numItems :
            if count + numItems >= 50 :
               numItems = 50 - count
               st.playSound("ItemSound.quest_middle")
               st.set("cond","3")
            else:
               st.playSound("ItemSound.quest_itemget")   
            st.giveItems(VACUALITE_ORE,int(numItems)) 
      return

QUEST       = Quest(618,qn,"Into the Flame")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(KLEIN)
QUEST.addTalkId(KLEIN)
QUEST.addTalkId(HILDA)

for mob in range(21274,21278)+range(21282,21286)+range(21290,21294) :
    QUEST.addKillId(mob)

for item in range(7265,7267) :
    STARTED.addQuestDrop(KLEIN,item,1)
开发者ID:eskruolis,项目名称:la2hardcore,代码行数:31,代码来源:__init__.py

示例5: onTalk

 def onTalk (self,npc,player):
   htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
   st = player.getQuestState(qn)
   if not st : return htmltext

   npcId = str(npc.getNpcId())
   id = st.getState()
   if id == CREATED :
     st.set("cond","0")
   if st.getInt("cond") == 0:   
     htmltext = npcId+"-01.htm"
   elif check(st) :
     htmltext = npcId+"-03.htm"
   elif st.getQuestItemsCount(RED_SOUL_CRYSTAL0_ID) == st.getQuestItemsCount(GREEN_SOUL_CRYSTAL0_ID) == st.getQuestItemsCount(BLUE_SOUL_CRYSTAL0_ID) == 0 :
     htmltext = npcId+"-21.htm"
   return htmltext

QUEST       = Quest(350,qn,"Enhance Your Weapon")
CREATED     = State('Start', QUEST)
STARTING     = State('Starting', QUEST)
STARTED     = State('Started', QUEST)

QUEST.setInitialState(CREATED)

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

STARTED.addQuestDrop(4629,RED_SOUL_CRYSTAL0_ID,1)
STARTED.addQuestDrop(4640,GREEN_SOUL_CRYSTAL0_ID,1)
STARTED.addQuestDrop(4651,BLUE_SOUL_CRYSTAL0_ID,1)
开发者ID:eskruolis,项目名称:la2hardcore,代码行数:31,代码来源:__init__.py


注:本文中的com.l2jfrozen.gameserver.model.quest.State类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。