• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python quest.State类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onKill

                htmltext = "7095-0a.htm"
                st.exitQuest(1)
        elif cond == 1:
            if not st.getQuestItemsCount(TREASURE_CHEST):
                htmltext = "7095-2.htm"
            else:
                htmltext = "7095-4.htm"
        return htmltext

    def onKill(self, npc, st):
        chance = st.getRandom(100)
        if chance < CHANCE_OF_DROP:
            st.giveItems(TREASURE_CHEST, 1)
            st.playSound("ItemSound.quest_itemget")
        return


QUEST = Quest(365, "365_DevilsLegacy", "Devil's Legacy")
CREATED = State("Start", QUEST)
STARTED = State("Started", QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(RANDOLF)
CREATED.addTalkId(RANDOLF)
STARTED.addTalkId(RANDOLF)
for mob in MOBS:
    STARTED.addKillId(mob)

STARTED.addQuestDrop(RANDOLF, TREASURE_CHEST, 1)
print "importing quests: 365: Devil's Legacy"
开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:30,代码来源:__init__.py


示例2: onKill

 def onKill (self,npc,player):
    partyMember = self.getRandomPartyMemberState(player, STARTED)
    if not partyMember : return
    st = partyMember.getQuestState(qn)
    chance = CHANCE[npc.getNpcId()]*Config.RATE_DROP_QUEST
    numItems, chance = divmod(chance,MAX)
    if st.getRandom(MAX)<chance :
      numItems = numItems + 1
    if numItems != 0 :
      st.giveItems(ANCIENT_SCROLL,int(numItems))
      st.playSound("ItemSound.quest_itemget")
    return

QUEST       = Quest(385,qn,"Yoke of the Past")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)

QUEST.setInitialState(CREATED)

for npcId in range(31095,31126):
    if npcId in [31111,31112,31113]:
        continue
    QUEST.addTalkId(npcId)
    QUEST.addStartNpc(npcId)

for mobs in range(21208,21256):
    QUEST.addKillId(mobs)

STARTED.addQuestDrop(20986,ANCIENT_SCROLL,1)

print "importing quests: 385: Yoke of the Past"
开发者ID:lorck,项目名称:svn,代码行数:31,代码来源:__init__.py


示例3: Quest

            if st.getQuestItemsCount(SEED_OF_VERDURE_ID) and st.getQuestItemsCount(BREATH_OF_WINDS_ID) :
              st.set("cond","3")
              st.playSound("Itemsound.quest_middle")
            else :
              st.playSound("Itemsound.quest_itemget")
          elif npcId == 20213 :                              # Condition 19 Porta
            st.set("cond","20")
            st.playSound("ItemSound.quest_middle")
        else:
          st.playSound("Itemsound.quest_itemget")
   return

QUEST       = Quest(217,qn,"Testimony Of Trust")
CREATED     = State('Start', QUEST)
STARTING    = State('Starting', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)


QUEST.setInitialState(CREATED)
QUEST.addStartNpc(30191)

QUEST.addTalkId(30191)

QUEST.addTalkId(30031)
QUEST.addTalkId(30154)
QUEST.addTalkId(30358)
QUEST.addTalkId(30464)
QUEST.addTalkId(30515)
QUEST.addTalkId(30531)
QUEST.addTalkId(30565)
开发者ID:lorck,项目名称:svn,代码行数:31,代码来源:__init__.py


示例4: onTalk

      htmltext = "Trade has been canceled."
    
    if htmltext != event:
      st.setState(COMPLETED)
      st.exitQuest(1)

    return htmltext

 def onTalk (Self,npc,st):

   npcId = npc.getNpcId()
   htmltext = "<html><head><body>I have nothing to say to you.</body></html>"
   st.set("cond","0")
   st.setState(STARTED)
   return "1.htm"

QUEST       = Quest(1005,"1005_unseal","Blacksmith")
CREATED     = State('Start',     QUEST)
STARTED     = State('Started',   QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)

QUEST.addStartNpc(8126)

STARTED.addTalkId(8126)




开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:26,代码来源:__init__.py


示例5: Quest

     if not st : return 
     if st.getState() != STARTED : return 
     npcId = npc.getNpcId()
     cond = st.getInt("cond")
     random = st.getRandom(100)
     if random<=CHANCE :
         st.giveItems(LIZARD_FANG,st.getRandom(5)+1)
         st.playSound("ItemSound.quest_itemget")
     if random<=CHANCE2 :
         st.giveItems(BARREL_OF_LEAGUE,1)
         st.set("cond","2")
     return

QUEST       = Quest(351,qn,"Black Swan")
CREATED     = State('Start', QUEST)
STARTED     = State('Started', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(30916)

QUEST.addTalkId(30916)
QUEST.addTalkId(30969)
QUEST.addTalkId(30897)

STARTED.addQuestDrop(30916,ORDER_OF_GOSTA,1)
STARTED.addQuestDrop(30916,BARREL_OF_LEAGUE,1)
STARTED.addQuestDrop(30916,LIZARD_FANG,1)

QUEST.addKillId(20784)
QUEST.addKillId(20785)
QUEST.addKillId(21639)
开发者ID:lorck,项目名称:svn,代码行数:31,代码来源:__init__.py


示例6: range

            st.giveItems(CHAPTER_OF_WIND, 1)
            st.playSound("ItemSound.quest_itemget")
        elif chance in range(75, 90) and st.getQuestItemsCount(CHAPTER_OF_EARTH) == 0:
            st.giveItems(CHAPTER_OF_EARTH, 1)
            st.playSound("ItemSound.quest_itemget")
        if (
            st.getQuestItemsCount(CHAPTER_OF_FIRE)
            and st.getQuestItemsCount(CHAPTER_OF_WATER)
            and st.getQuestItemsCount(CHAPTER_OF_WIND)
            and st.getQuestItemsCount(CHAPTER_OF_EARTH)
        ):
            st.playSound("ItemSound.quest_middle")
        return


QUEST = Quest(370, "370_AWisemanSowsSeeds", "A Wiseman Sows Seeds")
CREATED = State("Start", QUEST)
STARTED = State("Started", QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(CASIAN)
CREATED.addTalkId(CASIAN)
STARTED.addTalkId(CASIAN)
for i in MOBS:
    STARTED.addKillId(i)

for i in range(5917, 5921):
    STARTED.addQuestDrop(CASIAN, i, 1)

print "importing quests: 370: A Wiseman Sows Seeds"
开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:30,代码来源:__init__.py


示例7: int

            else:
              st.playSound("ItemSound.quest_itemget")
   elif npcId == 456 :
        st.set("id","0")
        if int(st.get("cond")) == 1 :
          if st.getRandom(10)<4 and st.getQuestItemsCount(DARK_BEZOAR_ID)<13 :
            st.giveItems(DARK_BEZOAR_ID,1)
            if st.getQuestItemsCount(DARK_BEZOAR_ID) == 13 :
              st.playSound("ItemSound.quest_middle")
            else:
              st.playSound("ItemSound.quest_itemget")
   return

QUEST       = Quest(165,"165_WildHunt","Wild Hunt")
CREATED     = State('Start', QUEST)
STARTING     = State('Starting', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)


QUEST.setInitialState(CREATED)
QUEST.addStartNpc(7348)

STARTING.addTalkId(7348)

STARTED.addTalkId(7348)

STARTED.addKillId(456)
STARTED.addKillId(529)
STARTED.addKillId(532)
STARTED.addKillId(536)
开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:31,代码来源:__init__.py


示例8: giveItem

              maxcount*=4
          giveItem(itemList[stoneRandom],maxcount,leader_st)
        elif len(itemList) :
          giveItem(itemList[0],maxcount,leader_st)
        else:
          if npcId == 27181:                # Imperial Gravekeeper
            leader_st.getPcSpawn().addSpawn(30765,120000,["Curse of the gods on the one that defiles the property of the empire!"],60000)
            leader_st.set("ImpGraveKeeper","3")
            self.ImpGraveKepperStat = 1
          elif npcId == 20668:
            leader_st.getPcSpawn().addSpawn(27179)
    return

QUEST     = Quest(503,qn,"Pursuit of Clan Ambition")
CREATED   = State('Start', QUEST)
PROGRESS  = State('Progress', QUEST)
COMPLETED = State('Completed', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(NPC[3])

for npcId in NPC:
  QUEST.addTalkId(npcId)

for mobId in DROPLIST.keys():
  QUEST.addKillId(mobId)

QUEST.addAttackId(27181)

for i in range(3839,3848)+range(3866,3870):
    PROGRESS.addQuestDrop(27181,i,1)
开发者ID:lorck,项目名称:svn,代码行数:31,代码来源:__init__.py


示例9: Quest

   count = st.getQuestItemsCount(KASHA_WOLF_FANG)  
   if count < 50 :
      if st.getRandom(100) <= 25 and count < 49 :
         st.giveItems(KASHA_WOLF_FANG,2)
         count += 2
      else :
         st.giveItems(KASHA_WOLF_FANG,1)
         count += 1
      if count >= 50 :
         st.playSound("ItemSound.quest_middle")
         st.set("cond","2")
      else:
         st.playSound("ItemSound.quest_itemget")
   return

QUEST       = Quest(271,qn,"Proof Of Valor")
CREATED     = State('Start', QUEST)
STARTING    = State('Starting', QUEST) # kept just for backwards compatibility
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)

QUEST.setInitialState(CREATED)
QUEST.addStartNpc(30577)

QUEST.addTalkId(30577)

QUEST.addKillId(20475)
STARTED.addQuestDrop(20475,KASHA_WOLF_FANG,1)

print "importing quests: 271: Proof Of Valor"
开发者ID:ProjectZeroL2,项目名称:svn,代码行数:30,代码来源:__init__.py


示例10: Quest

                st.playSound("ItemSound.quest_middle")
                if part == 1:
                    count = 0
                    for items in [GOLDEN_SEED1_ID, GOLDEN_SEED2_ID, GOLDEN_SEED3_ID]:
                        count += st.getQuestItemsCount(items)
                    if count > 2:
                        st.set("cond", "5")
            else:
                st.giveItems(item, 1)
                st.playSound("ItemSound.quest_itemget")
        return


QUEST = Quest(228, "228_TestOfMagus", "Test Of Magus")
CREATED = State("Start", QUEST)
STARTING = State("Starting", QUEST)
STARTED = State("Started", QUEST)
COMPLETED = State("Completed", QUEST)


QUEST.setInitialState(CREATED)
QUEST.addStartNpc(7629)

STARTING.addTalkId(7629)

for npcId in [7391, 7409, 7411, 7412, 7413, 7612, 7629]:
    STARTED.addTalkId(npcId)

for mobId in [145, 157, 176, 230, 231, 232, 234, 5095, 5096, 5097, 5098, 553, 564, 565, 566]:
    STARTED.addKillId(mobId)
开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:30,代码来源:__init__.py


示例11: str

    htmltext = event
    if event == "0" :
        return InitialHtml
    for item in Items :
        if event == str(item[1]):
            htmltext = do_RequestedEvent(event, st, item[1], item[2], item[3], item[4], item[5], item[6])
    if htmltext != event :
      st.setState(COMPLETED)
      st.exitQuest(1)
    return htmltext

 def onTalk (Self,npc,st):
   htmltext = "<html><head><body>I have nothing to say with you</body></html>"
   return InitialHtml

### Quest class and state definition
QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED     = State('Start',     QUEST)
COMPLETED   = State('Completed', QUEST)

### Quest initialization
QUEST.setInitialState(CREATED)

for item in NPC:
### Quest NPC starter initialization
   QUEST.addStartNpc(item)
### Quest NPC initialization
   CREATED.addTalkId(item)

print "...done"
开发者ID:ivanovkrasen,项目名称:C4-Datapack,代码行数:30,代码来源:__init__.py


示例12: do_RequestEvent

    return do_RequestEvent(event,st)

 def onTalk (Self,npc,st):

   npcId = npc.getNpcId()
   htmltext = "<html><head><body>I have nothing to say with you</body></html>"
   st.setState(STARTED)
   if InitialHtml == "onEvent" :
     return do_RequestEvent(str(npcId),st)
   elif InitialHtml != "" :
     return InitialHtml
   return htmltext

### Quest class and state definition
QUEST       = Quest(QuestId, str(QuestId) + "_" + QuestName, QuestDesc)
CREATED     = State('Start',     QUEST)
STARTED     = State('Started',   QUEST)
COMPLETED   = State('Completed', QUEST)

### Quest initialization
QUEST.setInitialState(CREATED)

for item in NPC:
### Quest NPC starter initialization
   QUEST.addStartNpc(item)

### Quest NPC initialization
   STARTED.addTalkId(item)

print  ": Loaded " + str(len(Items)) + " item(s)"
开发者ID:ProjectZeroL2,项目名称:svn,代码行数:30,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python jython.QuestJython类代码示例发布时间:2022-05-27
下一篇:
Python monad.Monad类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap