Exemplo n.º 1
0
 def onAcquireSkill (self, npc, player, skill) :
   if player.isSubClassActive():
     player.sendMessage("You are trying to learn skill that u can't..");
     Util.handleIllegalPlayerAction(player, "Player " + player.getName() + " tried to learn skill that he can't!!!", Config.DEFAULT_PUNISH);
     return "false"
   st = player.getQuestState(qn)
   for i in SKILLITEMS:
     if skill.getId() in SUBSKILLS[i]:
       for var in QUESTVARSITEMS:
         if i in QUESTVARSITEMS[var]:
           for j in range(Config.MAX_SUBCLASS):
             qvar = st.getGlobalQuestVar(var+str(j+1))
             if qvar != "" and qvar != "0" and not qvar.endswith(";") :
               Item = player.getInventory().getItemByObjectId(int(qvar))
               if Item and Item.getItemId() == i:
                 player.destroyItem(qn,int(qvar), 1, player, 0)
                 st.saveGlobalQuestVar(var+str(j+1),str(skill.getId())+";")
                 return "true"
   player.sendPacket(SystemMessage(SystemMessageId.ITEM_MISSING_TO_LEARN_SKILL))
   return "false"
Exemplo n.º 2
0
def checkConditions(player, new) :
	party = player.getParty()
	if not party :
		player.sendPacket(SystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER))
		return False
	if not player.getParty().isLeader(player) :
		player.sendPacket(SystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER))
		return False
	if party and party.getMemberCount() < 2 :
		player.sendPacket(SystemMessage(SystemMessageId.PARTY_EXCEEDED_THE_LIMIT_CANT_ENTER))
		return False
	for partyMember in party.getPartyMembers().toArray():
		if not partyMember.getLevel() >= 78 :
			sm = SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT)
			sm.addCharName(partyMember)
			player.sendPacket(sm)
			return False
		if not Util.checkIfInRange(1000, player, partyMember, True) and new :
			sm = SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED)
			sm.addCharName(partyMember)
			player.sendPacket(sm)
			return False
	return True