def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('afarathu_cult_brute')
    mobileTemplate.setLevel(30)
    mobileTemplate.setDifficulty(Difficulty.NORMAL)
    mobileTemplate.setMinSpawnDistance(4)
    mobileTemplate.setMaxSpawnDistance(8)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setScale(1)
    mobileTemplate.setSocialGroup("afarathu")
    mobileTemplate.setAssistRange(6)
    mobileTemplate.setStalker(True)
    mobileTemplate.setOptionsBitmask(Options.ATTACKABLE)

    templates = Vector()
    templates.add('object/mobile/shared_dressed_selonian_m_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_12.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_12.iff')
    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/polearm/shared_polearm_vibro_axe.iff',
        WeaponType.POLEARMMELEE, 1.0, 5, 'kinetic')
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('meleeHit')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 100
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    core.spawnService.addMobileTemplate('afarathu_cult_follower',
                                        mobileTemplate)
    return
Example #2
0
 def __init__(self, *literals):
     self.vector = Vector()
     self.addAll(*literals)
def doIt():
    global offre
    global tour
    tour = tour + 1
    attendre = 0
    coordonnees.setX(coordonnees.getX() + getDeplX())
    coordonnees.setY(coordonnees.getY() + getDeplY())

    # Time to live decremente
    aide.decrementer()

    if aide.besoin() and coordonnees.distanceTo(aide.getCoord()) <= 90:
        aide.finAssistance()

    #Rechargement des roquettes?
    if not attenteRoquettes.pret():
        attenteRoquettes.decrementer()

    lireMessages()

    if synchro.pret():
        monEtat()
    synchro.decrementer()

    base_cible = Point()
    if base_ennemie != []:
        for b in base_ennemie:
            if aide.setAssistance(coordonnees, self.getName(), b.getX(),
                                  b.getY(), 10000, AIDE_BASE_ENNEMIE, 3, tour):
                base_cible = b

    # Deplacement normal
    if aide.besoin():
        direct = self.towards(aide.getVisee().getX() - coordonnees.getX(),
                              aide.getVisee().getY() - coordonnees.getY())
        if coordonnees.distanceTo(aide.getCoord()) > 150 or (
                aide.besoin() > AIDE_LAUNCHER
                or aide.besoin() == AIDE_BASE_ENNEMIE):
            self.setHeading(direct)
        else:
            self.setHeading(180 + direct)

    # BaryCentre des unites ennemies proches
    centre = Point()
    percepts = self.getPercepts()
    nb_unites = 0

    ennemi_perdu = ennemi_courant.existe()
    qg_ennemi_visible = not (base_cible.estConnu()
                             and base_cible.distanceTo(coordonnees) <= 100)
    for p in percepts:
        team = p.getTeam()
        type_percept = p.getPerceptType()
        if ((type_percept == "Home") or (type_percept == "RocketLauncher") or
            (type_percept == "Explorer")) and team != self.getTeam():
            if p.getPerceptType() == "Home":
                base_abs = Point(p.getX() + coordonnees.getX(),
                                 p.getY() + coordonnees.getY())
                if not baseEnnemieConnue(base_abs):
                    base_ennemie.append(base_abs)
                    self.broadcast(groupName, "info", "INFO-QG", str(p.getX()),
                                   str(p.getY()))
                qg_ennemi_visible = qg_ennemi_visible or base_abs.distanceTo(
                    base_cible) <= 10
            coord = Point(p.getX() + coordonnees.getX(),
                          p.getY() + coordonnees.getY())
            energie = p.getEnergy()
            if not ennemi_courant.existe():
                ennemi_courant.setCible(type_percept, coord, energie, tour)
                #self.broadcast(groupName, "launcher", "FIN")
                args = [str(p.getX()), str(p.getY()), str(p.getEnergy())]
                if type_percept == "RocketLauncher":
                    self.broadcast(groupName, "launcher", "HELP2", args)
            elif ennemi_courant.egal(type_percept, coord):
                ennemi_courant.setCible(type_percept, coord, energie, tour)
                ennemi_perdu = 0
            elif (ennemi_courant.getEnergy() > p.getEnergy()) and prioriteType(
                    ennemi_courant.getType()) <= prioriteType(
                        p.getPerceptType()):
                ennemi_courant.setCible(type_percept, coord, energie, tour)
                ennemi_perdu = 0

    if base_cible.estConnu() and not qg_ennemi_visible:
        baseEnnemieSuppr(base_cible)
        self.broadcast(groupName, "mobile", "FIN-QG",
                       str(base_cible.getX() - coordonnees.getX()),
                       str(base_cible.getY() - coordonnees.getY()))

#	if ennemi_courant.existe():
#		self.setUserMessage("TIR")
#	else:
#		self.setUserMessage(None)

    if ennemi_perdu:
        self.broadcast(groupName, "launcher", "FIN")
        self.broadcast(groupName, "launcher", "ETAT")
        self.broadcast(groupName, "explorer", "ETAT")
        self.setHeading(
            self.towards(ennemi_courant.getX() - coordonnees.getX(),
                         ennemi_courant.getY() - coordonnees.getY()))
        ennemi_courant.delCible()

    elif (ennemi_courant.existe()):
        coord = ennemi_courant.viser(coordonnees)
        if tirer(coord):
            return

    # Manoeuvres d"evitement
    gentils = Point()
    mechants = Point()
    nb_mechants = 0
    nb_gentils = 0
    evite = Point()
    amis = Vector()
    tenaille = Point()

    #	self.getName()
    liste_amis = []
    liste_rockets = []
    if aide.besoin():
        dist_aide = aide.getVisee().distanceTo(coordonnees)
    else:
        dist_aide = 1000
    for p in percepts:
        dist = self.distanceTo(p)
        if p.getPerceptType() == "RocketLauncher" and p.getTeam(
        ) == self.getTeam():
            liste_amis.append(p)
            r = Mobile(coordonnees.getX() + p.getX(),
                       coordonnees.getY() + p.getY())
            amis.add(r)
            if aide.besoin() == AIDE_LAUNCHER:
                p_ami = Point(p.getX() + coordonnees.getX(),
                              p.getY() + coordonnees.getY())
                dist_ami = p_ami.distanceTo(aide.getVisee())
                if dist_aide > 200 and dist_ami > dist_aide + 20:
                    attendre = 1
        if p.getPerceptType() == "Rocket":
            liste_rockets.append(p)
        if p.getPerceptType() == "Home" and p.getTeam() == self.getTeam():
            liste_amis.append(p)
        ecart_min = ecartMin(p)
        if dist > 0 and dist < ecart_min:
            mult = (ecart_min - dist) / ecart_min
            if p.getPerceptType() == "Obstacle" or (p.getTeam()
                                                    == self.getTeam()):
                gentils.setCoord(gentils.getX() - p.getX() / dist * mult,
                                 gentils.getY() - p.getY() / dist * mult)
                nb_gentils += 1
            else:
                nb_mechants += 1
                mechants.setCoord(mechants.getX() - p.getX() / dist * mult,
                                  mechants.getY() - p.getY() / dist * mult)

    mon_groupe.amisVus(amis)

    if attendre:
        self.setHeading(self.getHeading() + 180)

    rocket_dangereuse = eviteRockets(liste_rockets)

    tirer_loin = aide.besoin(
    ) and aide.getVisee().distanceTo(coordonnees) < 200
    # Si on voit une rocket sans voir d"ennemi
    if rocket_dangereuse != None and not tirer_loin:
        d = coordonnees.distanceTo(rocket_dangereuse)
        # Estimation de la pos de l"ennemi : a 150 de distance
        x = (rocket_dangereuse.getX() - coordonnees.getX()) / d * 150
        y = (rocket_dangereuse.getY() - coordonnees.getY()) / d * 150
        args = [str(x), str(y), str(10000)]
        self.broadcast(groupName, "launcher", "ROCKET", args)
        #Demande a un explorateur de venir voir s"il y a quelqu"un
        if offre == None:
            self.broadcast(groupName, "explorer", "ROCKET-REQ", str(x), str(y))
        else:
            self.send(offre, "ROCKET-OK", str(x), str(y))

    if rocket_dangereuse != None and attenteRoquettes.pret():
        if tirer(rocket_dangereuse):
            return

    if tirer_loin:
        pos = Point()
        pos.setCoord(aide.getVisee().getX(), aide.getVisee().getY())
        if tirer(pos):
            return

    # Besoin de construire des rockets?
    seuil_rocket = 50
    if tirer_loin:
        seuil_rocket = 10

    if (self.getRocketNumber() < seuil_rocket):
        #	self.setUserMessage("Reconstruction Rockets")
        self.buildRocket()
        return
    #else:
    self.setUserMessage(self.getTeam())

    if mon_groupe.nbVus() != 0:
        centre = mon_groupe.barycentre()
        if not aide.besoin():
            if coordonnees.distanceTo(centre) > 60:
                direct = self.getHeading() * Math.PI / 180
                but_virtuel = Point()
                but_virtuel.setCoord(35 * Math.cos(direct),
                                     35 * Math.sin(direct))
                self.setHeading(
                    self.towards(
                        but_virtuel.getX() + centre.getX() -
                        coordonnees.getX(),
                        but_virtuel.getY() + centre.getY() -
                        coordonnees.getY()))
            formation = mon_groupe.vecteurMoyen()
            direct = self.getHeading() * Math.PI / 180
            but_virtuel = Point()
            but_virtuel.setCoord(1 * Math.cos(direct), 1 * Math.sin(direct))
            self.setHeading(
                self.towards(but_virtuel.getX() + formation.getX(),
                             but_virtuel.getY() + formation.getY()))

    eviteAmis(liste_amis)

    if nb_gentils > 0:
        direct = self.getHeading() * Math.PI / 180
        but_virtuel = Point()
        if aide.besoin() and aide.getVisee().distanceTo(coordonnees) < 200:
            but_virtuel.setCoord(Math.cos(direct), Math.sin(direct))
        else:
            but_virtuel.setCoord(5 * Math.cos(direct), 5 * Math.sin(direct))
        self.setHeading(
            self.towards(but_virtuel.getX() + gentils.getX(),
                         but_virtuel.getY() + gentils.getY()))

    if nb_mechants > 0:
        direct = self.getHeading() * Math.PI / 180
        but_virtuel = Point()
        but_virtuel.setCoord(2 * Math.cos(direct), 2 * Math.sin(direct))
        self.setHeading(
            self.towards(but_virtuel.getX() + mechants.getX(),
                         but_virtuel.getY() + mechants.getY()))

    self.move()
Example #4
0
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('afarathu_cult_hellion')
    mobileTemplate.setLevel(30)
    mobileTemplate.setDifficulty(Difficulty.NORMAL)
    mobileTemplate.setMinSpawnDistance(4)
    mobileTemplate.setMaxSpawnDistance(8)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setScale(1)
    mobileTemplate.setSocialGroup("afarathu")
    mobileTemplate.setAssistRange(6)
    mobileTemplate.setStalker(True)
    mobileTemplate.setOptionsBitmask(Options.AGGRESSIVE | Options.ATTACKABLE)

    templates = Vector()
    templates.add('object/mobile/shared_dressed_selonian_m_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_12.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_12.iff')
    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/ranged/carbine/shared_carbine_e11.iff',
        WeaponType.CARBINE, 1.0, 15, 'energy')
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('rangedShot')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 100
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    core.spawnService.addMobileTemplate('afarathu_cult_hellion',
                                        mobileTemplate)
    return
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('outbreak_afflicted_lvl_70')
    mobileTemplate.setLevel(70)
    mobileTemplate.setDifficulty(Difficulty.NORMAL)

    mobileTemplate.setMinSpawnDistance(5)
    mobileTemplate.setMaxSpawnDistance(10)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setSocialGroup('undead')
    mobileTemplate.setAssistRange(15)
    mobileTemplate.setRespawnTime(300)
    mobileTemplate.setOptionsBitmask(Options.AGGRESSIVE | Options.ATTACKABLE)

    templates = Vector()
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_01_f.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_01_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_02_f.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_03_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_04_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_05_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_06_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_07_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_08_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_09_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_10_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_11_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_12_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_13_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_14_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_15_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_16_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_17_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_18_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_19_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_20_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_21_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_22_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_23_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_24_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_25_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_26_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_27_m.iff')
    templates.add('object/mobile/shared_outbreak_undead_deathtrooper_28_m.iff')
    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/ranged/rifle/shared_rifle_e11.iff', WeaponType.RIFLE,
        0.8, 0, 'energy')
    weaponTemplates.add(weapontemplate)
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/unarmed/shared_unarmed_default.iff',
        WeaponType.ONEHANDEDMELEE, 1.0, 4, 'kinetic')
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('RangedShot')
    mobileTemplate.setDefaultAttack('MeleeHit')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 65
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    lootPoolNames_4 = ['random_stat_jewelry']
    lootPoolChances_4 = [100]
    lootGroupChance_4 = 8
    mobileTemplate.addToLootGroups(lootPoolNames_4, lootPoolChances_4,
                                   lootGroupChance_4)

    core.spawnService.addMobileTemplate('outbreak_afflicted_lvl_70',
                                        mobileTemplate)

    return
Example #6
0
def handleFirstScreen(core, actor, npc, selection):

    convSvc = core.conversationService
    if actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial':
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_432')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_434')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_440')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSecondScreen)
            return

        if selection == 1:
            return

        if selection == 2:
            core.conversationService.sendStopConversation(
                actor, npc, 'conversation/faction_recruiter_imperial', 's_442')
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.OnLeave:
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_50')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_97')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_93')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_88')
            outOfBand4 = OutOfBand()
            outOfBand4.addProsePackage(prose4)
            prose5 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_55')
            outOfBand5 = OutOfBand()
            outOfBand5.addProsePackage(prose5)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)
            option3 = ConversationOption(outOfBand4, 1)
            option4 = ConversationOption(outOfBand5, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)
            options.add(option3)
            options.add(option4)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSecondScreen)
            return

        if selection == 1:
            percent = core.guildService.getGuildObject(
            ).getCurrentServerGCWTotalPercentMap().get(
                actor.getPlanet().getName()).getPercent().intValue()
            convSvc.sendConversationMessage(
                actor, npc,
                OutOfBand.ProsePackage(
                    "@conversation/faction_recruiter_imperial:s_412", percent,
                    "TO", str(100 - percent)))
            return

        if selection == 2:
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.Combatant:
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_50')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_74')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_93')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_88')
            outOfBand4 = OutOfBand()
            outOfBand4.addProsePackage(prose4)
            prose5 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_55')
            outOfBand5 = OutOfBand()
            outOfBand5.addProsePackage(prose5)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)
            option3 = ConversationOption(outOfBand4, 1)
            option4 = ConversationOption(outOfBand5, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)
            options.add(option3)
            options.add(option4)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSecondScreen)
            return

        if selection == 1:
            percent = core.guildService.getGuildObject(
            ).getCurrentServerGCWTotalPercentMap().get(
                actor.getPlanet().getName()).getPercent().intValue()
            convSvc.sendConversationMessage(
                actor, npc,
                OutOfBand.ProsePackage(
                    "@conversation/faction_recruiter_imperial:s_412", percent,
                    "TO", str(100 - percent)))
            return

        if selection == 2:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_90')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_92')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_96')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSecondScreen)
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.SpecialForces:
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_50')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_74')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_97')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_88')
            outOfBand4 = OutOfBand()
            outOfBand4.addProsePackage(prose4)
            prose5 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_55')
            outOfBand5 = OutOfBand()
            outOfBand5.addProsePackage(prose5)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)
            option3 = ConversationOption(outOfBand4, 1)
            option4 = ConversationOption(outOfBand5, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)
            options.add(option3)
            options.add(option4)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSecondScreen)
            return

        if selection == 1:
            percent = core.guildService.getGuildObject(
            ).getCurrentServerGCWTotalPercentMap().get(
                actor.getPlanet().getName()).getPercent().intValue()
            convSvc.sendConversationMessage(
                actor, npc,
                OutOfBand.ProsePackage(
                    "@conversation/faction_recruiter_imperial:s_412", percent,
                    "TO", str(100 - percent)))
            return

        if selection == 2:

            return
        return
Example #7
0
def handleSecondScreen(core, actor, npc, selection):
    convSvc = core.conversationService

    if actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial':
        if selection == 0:
            actor.setFaction('imperial')
            actor.setFactionStatus(FactionStatus.OnLeave)

            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_116')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_438')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            option1 = ConversationOption(outOfBand2, 0)

            options = Vector()
            options.add(option1)

            core.conversationService.sendStopConversation(
                actor, npc, 'conversation/faction_recruiter_imperial', 's_100')
            return
        if selection == 1:
            core.conversationService.sendStopConversation(
                actor, npc, 'conversation/faction_recruiter_imperial', 's_442')
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.OnLeave:
        if selection == 0:
            actor.setFactionStatus(FactionStatus.Combatant)
            core.conversationService.sendStopConversation(
                actor, npc, 'conversation/faction_recruiter_imperial', 's_300')
            return

        if selection == 1:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_64')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_66')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_302')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleFourthScreen)
            return
        if selection == 2:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_90')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_92')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_96')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleThirdScreen)
            return
        if selection == 3:
            core.conversationService.sendStopConversation(
                actor, npc, 'conversation/faction_recruiter_imperial', 's_95')
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.Combatant:
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_76')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_79')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_70')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleFithScreen)
            return

        if selection == 1:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_64')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_66')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_302')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleFourthScreen)
            return
        if selection == 2:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_90')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_92')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_96')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleThirdScreen)
            return
        if selection == 3:
            return
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.SpecialForces:
        if selection == 0:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_76')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_79')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_70')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleFithScreen)
            return

        if selection == 1:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_54')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_56')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_84')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleSixthScreen)
            return
        if selection == 2:
            prose = ProsePackage('conversation/faction_recruiter_imperial',
                                 's_90')
            outOfBand = OutOfBand()
            outOfBand.addProsePackage(prose)
            convSvc.sendConversationMessage(actor, npc, outOfBand)
            prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_92')
            outOfBand2 = OutOfBand()
            outOfBand2.addProsePackage(prose2)
            prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                                  's_96')
            outOfBand3 = OutOfBand()
            outOfBand3.addProsePackage(prose3)
            option1 = ConversationOption(outOfBand2, 0)
            option2 = ConversationOption(outOfBand3, 1)

            options = Vector()
            options.add(option1)
            options.add(option2)

            convSvc.sendConversationOptions(actor, npc, options,
                                            handleThirdScreen)
            return
        if selection == 3:
            return
        return
def addTemplate(core):
	mobileTemplates = Vector()
	mobileTemplates.add('vrelt')
		
	core.spawnService.addLairTemplate('corellia_vrelt_lair_1', mobileTemplates, 15, 'object/tangible/lair/base/poi_all_lair_garbage_small.iff')
	return
Example #9
0
def addSpawnArea(core):
    dynamicGroups = Vector()
    dynamicGroups.add('nightsisters_dyn_1')
    core.spawnService.addDynamicSpawnArea(dynamicGroups, -4055, -81, 2990,
                                          'dathomir')
    return
Example #10
0
def addSpawnArea(core):
	dynamicGroups = Vector()
	dynamicGroups.add('rori_borgle')
	dynamicGroups.add('rori_torton')
	core.spawnService.addDynamicSpawnArea(dynamicGroups, 5500, 5000, 3500, 'rori')
	return
Example #11
0
def newPlot(title):
    plotProp = G2dPanelProp()
    plotProp.hasToolbar = False
    return G2dDialog(None, title, False, Vector(), plotProp)
Example #12
0
def run(core, actor, target, commandString):

    # set the global variables
    global actorID
    global targetID
    global commandArgs
    global commandLength
    global tipAmount
    global tipAmountBank
    global bankSurcharge

    actorID = actor.getObjectID()
    targetID = target.getObjectID()
    commandArgs = commandString.split(" ")
    commandLength = len(commandArgs)
    tipAmount = commandArgs[0]
    tipAmountBank = commandArgs[0]
    bankSurcharge = int(0.05) * int(tipAmountBank)

    #/tip int || /tip target int
    if commandLength == 1:

        tipAmount = commandArgs[0]
        actorFunds = actor.getCashCredits()
        currentTarget = core.objectService.getObject(target.getObjectId())

        if (actor.inRange(target.getPosition(), 100)):  # 100 = 10m
            if int(tipAmount) > 0 and int(tipAmount) <= 1000000:
                if actorFunds >= int(tipAmount):
                    currentTarget.setCashCredits(int(tipAmount))
                    actor.setCashCredits(actorFunds - int(tipAmount))

                    currentTarget.sendSystemMessage(
                        actor.getCustomName() + ' tips you ' + tipAmount +
                        ' credits.', 0)
                    actor.sendSystemMessage(
                        'You successfully tip ' + tipAmount + ' credits to ' +
                        currentTarget.getCustomName() + '.', 0)
                    return
                actor.sendSystemMessage(
                    'You lack the cash funds to tip ' + tipAmount +
                    ' credits to ' + currentTarget.getCustomName() + '.', 0)
                return
            actor.sendSystemMessage(
                'Invalid tip amount, set amount between 1 and 1,000,000 credits',
                0)
            return
        actor.sendSystemMessage(
            'Target is too far away. Try a wire bank transfer instead.', 0)
        return

    #/tip target 30000000 bank
    if commandLength == 2:
        suiSvc = core.suiService
        suiWindow = suiSvc.createMessageBox(MessageBoxType.MESSAGE_BOX_YES_NO,
                                            "@base_player:tip_wire_title",
                                            "@base_player:tip_wire_prompt",
                                            actor, actor, 10)

        returnParams = Vector()
        returnParams.add('btnOk:Text')
        returnParams.add('btnCancel:Text')
        suiWindow.addHandler(0, '', Trigger.TRIGGER_OK, returnParams,
                             handleBankTip)
        suiWindow.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnParams,
                             handleBankTip)

        suiSvc.openSUIWindow(suiWindow)
        return
    return
Example #13
0
def to_vect(it):
    v = Vector()
    for e in it:
        v.addElement(e)
    return v
Example #14
0
def handleSelection(core, owner, target, option):
    if option == 69 and target:
        player = core.objectService.getObject(owner.getTargetId())
        tGhost = player.getSlottedObject('ghost')
        suiSvc = core.suiService

        if tGhost.getPosition().getDistance2D(owner.getWorldPosition()) < 50:
            owner.sendSystemMessage('@unity:out_of_range', 0)
            return

        if tGhost.getSpouseName() is not None:
            owner.sendSystemMessage('@unity:target_married', 0)
            return

        if player.getAttachment("proposer") is not None:
            owner.sendSystemMessage('@unity:target_proposed', 0)
            return

        else:

            owner.sendSystemMessage(
                'You propose unity to ' + player.getCustomName() + '.', 0)
            targetWindow = suiSvc.createMessageBox(
                3, '@unity:accept_title',
                owner.getCustomName() +
                ' is proposing unity to you. Do you wish to accept?',
                tGhost.getContainer(), owner, 15)
            returnList = Vector()

            targetWindow.addHandler(0, '', Trigger.TRIGGER_OK, returnList,
                                    handlePropose)
            targetWindow.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnList,
                                    handlePropose)
            player.setAttachment("proposer", owner.getCustomName())
            suiSvc.openSUIWindow(targetWindow)

            target.setAttachment("unity", True)
            core.equipmentService.equip(owner, target)

            core.commandService.callCommand(owner, 'kneel', None, '')
            return
        return

    if option == 70:
        married = owner.getSlottedObject('ghost').getSpouseName()
        myGhost = owner.getSlottedObject('ghost')
        otherPlayer = NGECore.getInstance(
        ).objectService.getObjectByCustomName(married)

        if otherPlayer is None:
            return
        ghost = otherPlayer.getSlottedObject('ghost')

        if ghost is None:
            return

        owner.sendSystemMessage('Your union with ' + married + ' has ended.',
                                0)
        otherPlayer.sendSystemMessage(
            'Your union with ' + owner.getCustomName() + ' has ended.', 0)
        myGhost.setSpouseName(None)
        ghost.setSpouseName(None)

        target.setAttachment("unity", None)
        #TODO: Divorce offline players
        return
    return
Example #15
0
def transferMoneyBank(tipFrom, tipTo, transferTotal, core):
    def handleBankTip(core, owner, eventType, returnList):
        bankSurcharge = int(math.ceil(0.05 * float(transferTotal))) 
        core = NGECore.getInstance()
        chatSvc = core.chatService
        actorGlobal = tipFrom
        targetGlobal = tipTo
        actorFunds = actorGlobal.getBankCredits()
        totalLost = int(transferTotal) + bankSurcharge
        
        if eventType == 0:
            if int(totalLost) > actorFunds:
                actorGlobal.sendSystemMessage('You do not have ' + str(totalLost) + ' credits (surcharge included) to tip the desired amount to ' + targetGlobal.getCustomName() + '.', 0)
                return
            if int(transferTotal) > 0 and int(actorFunds) >= int(totalLost):
                date = Date()
                targetName = targetGlobal.getCustomName()
     
                targetMail = Mail()
                targetMail.setMailId(chatSvc.generateMailId())
                targetMail.setTimeStamp((int) (date.getTime() / 1000))
                targetMail.setRecieverId(targetGlobal.getObjectId())
                targetMail.setStatus(Mail.NEW)
                targetMail.setMessage(`transferTotal` + ' credits from ' + actorGlobal.getCustomName() + ' have been successfully delivered from escrow to your bank account')
                targetMail.setSubject('@base_player:wire_mail_subject')
                targetMail.setSenderName('bank')
     
                actorMail = Mail()
                actorMail.setMailId(chatSvc.generateMailId())
                actorMail.setRecieverId(actorGlobal.getObjectId())
                actorMail.setStatus(Mail.NEW)
                actorMail.setTimeStamp((int) (date.getTime() / 1000))
                actorMail.setMessage('An amount of ' + `transferTotal` + ' credits have been transfered from your bank to escrow. It will be delivered to ' + targetGlobal.getCustomName() + ' as soon as possible.')
                actorMail.setSubject('@base_player:wire_mail_subject')
                actorMail.setSenderName('bank')
                 
                targetGlobal.addBankCredits(int(transferTotal))
                actorGlobal.deductBankCredits(int(totalLost))
                actorGlobal.sendSystemMessage('You have successfully sent ' + `transferTotal` + ' bank credits to ' + targetGlobal.getCustomName(), 0)
                targetGlobal.sendSystemMessage('You have successfully received ' + `transferTotal` + ' bank credits from ' + actorGlobal.getCustomName(), 0)
                 
                chatSvc.storePersistentMessage(actorMail)
                chatSvc.storePersistentMessage(targetMail)
                chatSvc.sendPersistentMessageHeader(actorGlobal.getClient(), actorMail)
                chatSvc.sendPersistentMessageHeader(targetGlobal.getClient(), targetMail)
                return             
        else:
            actorGlobal.sendSystemMessage('You lack the bank funds to wire ' + `transferTotal` + ' bank funds to ' + targetGlobal.getCustomName() + '.', 0)
            return        
        return
    
    suiSvc = core.suiService
    suiWindow = suiSvc.createMessageBox(MessageBoxType.MESSAGE_BOX_YES_NO, "@base_player:tip_wire_title", "@base_player:tip_wire_prompt", tipFrom, tipFrom, 10)
    
    returnParams = Vector()
    returnParams.add('btnOk:Text')
    returnParams.add('btnCancel:Text')
    suiWindow.addHandler(0, '', Trigger.TRIGGER_OK, returnParams, handleBankTip)
    suiWindow.addHandler(1, '', Trigger.TRIGGER_CANCEL, returnParams, handleBankTip)
    
    suiSvc.openSUIWindow(suiWindow)
list2 = ['a', 'b']
list3 = ['a', 'b', 'c']
dict0 = {}
dict1 = {'a':1}
dict2 = {'a':1, 'b':2}
dict3 = {'a':1, 'b':2, 'c':3}
custom0 = _Custom(0)
custom1 = _Custom(1)
custom2 = _Custom(2)
custom3 = _Custom(3)
length_method = _LengthMethod()
size_method = _SizeMethod()
length_attribute = _LengthAttribute()
if os.name == 'java':
    string0 = String()
    string1 = String('a')
    string2 = String('ab')
    string3 = String('abc')
    hashtable0 = Hashtable()
    hashtable1 = _create_hashtable(dict1)
    hashtable2 = _create_hashtable(dict2)
    hashtable3 = _create_hashtable(dict3)
    vector0 = Vector()
    vector1 = Vector(list1)
    vector2 = Vector(list2)
    vector3 = Vector(list3)
    array0 = jarray.array(list0, String)
    array1 = jarray.array(list1, String)
    array2 = jarray.array(list2, String)
    array3 = jarray.array(list3, String)
Example #17
0
from jarray import array
import types


def dictionaryToHashMap(dict):
    hash = HashMap()
    for key in dict.keys():
        hash.put(key, dict[key])
    return hash


####################
# Property Config
####################

jPropertyStructure = Vector()
for chunk in propertyStructure:
    className = chunk.pop(0)
    groupVec = Vector()
    for group in chunk:
        groupName = group.pop(0)
        propVec = Vector()
        for propertyName in group:
            propVec.add(propertyName)
        groupVec.add(StringObjectPair(groupName, propVec))
    jPropertyStructure.add(StringObjectPair(className, groupVec))
AuthoringToolResources.setPropertyStructure(jPropertyStructure)

AuthoringToolResources.setClassesToOmitNoneFor(
    array(classesToOmitNoneFor, java.lang.Class))
Example #18
0
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('selonian_warrior')
    mobileTemplate.setLevel(38)
    mobileTemplate.setDifficulty(0)
    mobileTemplate.setAttackRange(15)
    mobileTemplate.setAttackSpeed(1.0)
    mobileTemplate.setWeaponType(1)
    mobileTemplate.setMinSpawnDistance(4)
    mobileTemplate.setMaxSpawnDistance(8)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setScale(1)
    mobileTemplate.setSocialGroup("selonian")
    mobileTemplate.setAssistRange(6)
    mobileTemplate.setStalker(True)
    mobileTemplate.setOptionsBitmask(192)

    templates = Vector()
    templates.add('object/mobile/shared_dressed_selonian_m_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_m_12.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_01.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_02.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_03.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_04.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_05.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_06.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_07.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_08.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_09.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_10.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_11.iff')
    templates.add('object/mobile/shared_dressed_selonian_f_12.iff')
    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/ranged/carbine/shared_carbine_e11.iff', 1, 1.0)
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('rangedShot')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 100
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    core.spawnService.addMobileTemplate('selonian_warrior', mobileTemplate)
    return
Example #19
0
def startConversation(core, actor, npc):
    global coreRef
    global impRecruiterRef
    coreRef = core
    impRecruiterRef = npc
    convSvc = core.conversationService
    faction = actor.getFaction()
    factionStatus = actor.getFactionStatus()

    if actor.getPvpStatus(PvpStatus.GoingOvert) or actor.getPvpStatus(
            PvpStatus.GoingCovert):
        core.conversationService.sendStopConversation(
            actor, npc, 'conversation/faction_recruiter_imperial', 's_444')
        return
    elif actor.getFaction() != 'rebel' and actor.getFaction() != 'imperial':
        prose = ProsePackage('conversation/faction_recruiter_imperial',
                             's_414')
        outOfBand = OutOfBand()
        outOfBand.addProsePackage(prose)
        convSvc.sendConversationMessage(actor, npc, outOfBand)
        prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_428')
        outOfBand2 = OutOfBand()
        outOfBand2.addProsePackage(prose2)
        prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_85')
        outOfBand3 = OutOfBand()
        outOfBand3.addProsePackage(prose3)
        option1 = ConversationOption(outOfBand2, 0)
        option2 = ConversationOption(outOfBand3, 1)

        options = Vector()
        options.add(option1)
        options.add(option2)

        convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen)
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.OnLeave:
        prose = ProsePackage('conversation/faction_recruiter_imperial', 's_80')
        outOfBand = OutOfBand()
        outOfBand.addProsePackage(prose)
        convSvc.sendConversationMessage(actor, npc, outOfBand)
        prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_49')
        outOfBand2 = OutOfBand()
        outOfBand2.addProsePackage(prose2)
        prose3 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_410')
        outOfBand3 = OutOfBand()
        outOfBand3.addProsePackage(prose3)
        prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_324')
        outOfBand4 = OutOfBand()
        outOfBand4.addProsePackage(prose4)
        option1 = ConversationOption(outOfBand2, 0)
        option2 = ConversationOption(outOfBand3, 1)
        option3 = ConversationOption(outOfBand4, 1)

        options = Vector()
        options.add(option1)
        options.add(option2)
        options.add(option3)

        convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen)
        return
    elif actor.getFaction() == 'imperial' and actor.getFactionStatus(
    ) == FactionStatus.Combatant:
        prose = ProsePackage('conversation/faction_recruiter_imperial',
                             's_310')
        outOfBand = OutOfBand()
        outOfBand.addProsePackage(prose)
        convSvc.sendConversationMessage(actor, npc, outOfBand)
        prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_49')
        outOfBand2 = OutOfBand()
        outOfBand2.addProsePackage(prose2)
        prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_410')
        outOfBand4 = OutOfBand()
        outOfBand4.addProsePackage(prose4)
        prose5 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_324')
        outOfBand5 = OutOfBand()
        outOfBand5.addProsePackage(prose5)
        option1 = ConversationOption(outOfBand2, 0)
        option2 = ConversationOption(outOfBand4, 1)
        option4 = ConversationOption(outOfBand5, 1)

        options = Vector()
        options.add(option1)
        options.add(option2)
        options.add(option4)
        convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen)

        return
    elif actor.getFactionStatus() == FactionStatus.SpecialForces:
        prose = ProsePackage('conversation/faction_recruiter_imperial',
                             's_310')
        outOfBand = OutOfBand()
        outOfBand.addProsePackage(prose)
        convSvc.sendConversationMessage(actor, npc, outOfBand)
        prose2 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_49')
        outOfBand2 = OutOfBand()
        outOfBand2.addProsePackage(prose2)
        prose4 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_410')
        outOfBand4 = OutOfBand()
        outOfBand4.addProsePackage(prose4)
        prose5 = ProsePackage('conversation/faction_recruiter_imperial',
                              's_324')
        outOfBand5 = OutOfBand()
        outOfBand5.addProsePackage(prose5)
        option1 = ConversationOption(outOfBand2, 0)
        option2 = ConversationOption(outOfBand4, 1)
        option4 = ConversationOption(outOfBand5, 1)

        options = Vector()
        options.add(option1)
        options.add(option2)
        options.add(option4)
        convSvc.sendConversationOptions(actor, npc, options, handleFirstScreen)

        return
    elif actor.getFaction() == 'rebel':
        npc.setCurrentAnimation('all_b_emt_backhand')
        core.conversationService.sendStopConversation(
            actor, npc, 'conversation/faction_recruiter_imperial', 's_308')
        return
    return
Example #20
0
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('heroic_tusken_mos_espa_citizen')
    mobileTemplate.setLevel(90)
    mobileTemplate.setDifficulty(0)
    mobileTemplate.setAttackRange(12)
    mobileTemplate.setAttackSpeed(1.0)
    mobileTemplate.setWeaponType(6)
    mobileTemplate.setMinSpawnDistance(4)
    mobileTemplate.setMaxSpawnDistance(8)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setScale(1)
    mobileTemplate.setSocialGroup("heroic mos espa citizien")
    mobileTemplate.setAssistRange(12)
    mobileTemplate.setStalker(True)
    mobileTemplate.setOptionsBitmask(128)

    templates = Vector()
    templates.add('object/mobile/shared_warren_research_scientist.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_06.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_05.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_06.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_female_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_devaronian_male_03.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_02.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_08.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_ishitib_male_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_08.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_female_02.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_07.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_male_02.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_06.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_07.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_male_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_03.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_05.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_devaronian_male_02.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_ishitib_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_female_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_female_03.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_09.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_06.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_devaronian_male_01.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_04.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_07.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_05.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_female_04.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_female_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_05.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_06.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_06.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_male_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_05.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_05.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_bith_female_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_male_01.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_sullustan_male_04.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_devaronian_male_04.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_male_02.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_ishitib_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_01.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_01.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_female_03.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_trandoshan_female_01.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_aqualish_female_08.iff'
    )
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_nikto_male_08.iff')
    templates.add(
        'object/mobile/shared_dressed_commoner_tatooine_rodian_male_02.iff')
    templates.add('object/mobile/shared_dressed_twi_female_scientist_01.iff')
    templates.add('object/mobile/shared_warren_scientist_s01.iff')

    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/unarmed/shared_unarmed_default.iff', 6, 1.0)
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('meleeHit')
    mobileTemplate.setAttacks(attacks)

    core.spawnService.addMobileTemplate('heroic_mos_espa_citizen',
                                        mobileTemplate)
    return
Example #21
0
def addSpawnArea(core):
    dynamicGroups = Vector()
    dynamicGroups.add('dark_jedi_wild_1')
    core.spawnService.addDynamicSpawnArea(dynamicGroups, 5302, -4151, 300,
                                          'dathomir')
    return
Example #22
0
except TypeError:
    pass

print 'strings'
from java.lang import Integer, String

assert Integer.valueOf('42') == 42, 'Python string to Java string'

print 'arrays'
chars = ['a', 'b', 'c']
assert String.valueOf(chars) == 'abc', 'char array'

print 'Enumerations'
from java.util import Vector

vec = Vector()
items = range(10)
for i in items:
    vec.addElement(i)

expected = 0
for i in vec:
    assert i == expected, 'testing __iter__ on java.util.Vector'
    expected = expected + 1

expected = 0
for i in iter(vec):
    assert i == expected, 'testing iter(java.util.Vector)'
    expected = expected + 1

print 'create java objects'
def addSpawnArea(core):
	dynamicGroups = Vector()
	dynamicGroups.add('imperial')
	dynamicGroups.add('rebel')
	core.spawnService.addDynamicSpawnArea(dynamicGroups, -2595, 3724, 500, 'talus')
	return
Example #24
0
def addTemplate(core):
	mobileTemplates = Vector()
	mobileTemplates.add('krahbu')
		
	core.spawnService.addLairTemplate('corellia_krahbu_lair_1', mobileTemplates, 15, 'object/tangible/lair/base/poi_all_lair_thicket_small.iff')
	return
def addLairGroup(core):
    spawnTemplates = Vector()
    spawnTemplate = LairSpawnTemplate(-1, 'dantooine_voritor_lair_2', -1, -1)
    spawnTemplates.add(spawnTemplate)
    core.spawnService.addLairGroup('voritor_lair_group_2', spawnTemplates)
    return
Example #26
0
def startConversation(core, actor, npc):
    player = actor.getPlayerObject()

    if player is None:
        return

    quest = player.getQuest('tatooine_eisley_legacy')

    if quest is None:
        endConversation(core, actor, npc)
        return

    # Check if player finished the main talking quest, if they did then handle mayor and trehla return/not yet started options
    if quest.isCompleted() == True:

        if player.getQuest('tatooine_eisley_gotoniko') is not None:
            core.conversationService.sendStopConversation(
                actor, npc, '@conversation/c_newbie_secondchance', 's_59')
            return

        mayorVourk = player.getQuest('newbie_goto_vourk')
        if mayorVourk is not None:
            if mayorVourk.isCompleted() == False:
                # TODO: Mayor return conv. options
                return
            else:
                endConversation(core, actor, npc)
            return

        trehlaVourk = player.getQuest('return_to_vourk')
        if trehlaVourk is not None:
            if trehlaVourk.isCompleted() == False:
                # TODO: Trehla return conv. options
                return
            else:
                endConversation(core, actor, npc)
            return

        # Player doesn't have a return quest... Now we will check if they have any active quests for these..
        preTrehla = player.getQuest('tatooine_eisley_gototrehla_v2')
        if preTrehla is not None:
            if preTrehla.isCompleted() == False:
                core.conversationService.sendStopConversation(
                    actor, npc, '@conversation/c_newbie_secondchance', 's_61')
            elif hasActiveTrehlaQuest(
                    core, actor, npc,
                    player) == True:  # True = has a pre-quest to return quests
                core.conversationService.sendStopConversation(
                    actor, npc, '@conversation/c_newbie_secondchance', 's_61')
                return

        # Trehla checks failed, has to be on Mayor quests.
        endConversation(core, actor, npc)
        return

    if quest.getActiveTask() == 2:
        options = Vector()
        options.add(
            ConversationOption(
                OutOfBand.ProsePackage(
                    '@conversation/c_newbie_secondchance:s_118'), 0))
        core.conversationService.sendConversationMessage(
            actor, npc,
            OutOfBand.ProsePackage(
                '@conversation/c_newbie_secondchance:s_116'))
        core.conversationService.sendConversationOptions(
            actor, npc, options, handleOptionsOne)
        return

    endConversation(core, actor, npc)
    return
def addSpawnArea(core):
	mixedGroups = Vector()
	mixedGroups.add('piket_plains_walker_group')
	mixedGroups.add('mixed_lair_group_1')
	core.spawnService.addMixedSpawnArea(mixedGroups, 0, 2355, 1024, 'dantooine')
	return
Example #28
0
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('dark_jedi_master')
    mobileTemplate.setLevel(90)
    mobileTemplate.setDifficulty(Difficulty.BOSS)

    mobileTemplate.setMinSpawnDistance(3)
    mobileTemplate.setMaxSpawnDistance(5)
    mobileTemplate.setDeathblow(True)
    mobileTemplate.setSocialGroup('dark jedi')
    mobileTemplate.setAssistRange(12)
    mobileTemplate.setRespawnTime(300)
    mobileTemplate.setOptionsBitmask(Options.AGGRESSIVE + Options.ATTACKABLE)

    templates = Vector()
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_female_twk_01.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_female_twk_02.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_female_zab_01.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_female_zab_02.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_male_human_01.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_male_human_04.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_male_human_05.iff')
    templates.add(
        'object/mobile/shared_dressed_dark_jedi_master_male_human_06.iff')
    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_gen5.iff',
        WeaponType.ONEHANDEDSABER, 1.0, 6, 'energy')
    weaponTemplates.add(weapontemplate)
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_gen5.iff',
        WeaponType.TWOHANDEDSABER, 1.0, 6, 'energy')
    weaponTemplates.add(weapontemplate)
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/polearm/crafted_saber/shared_sword_lightsaber_polearm_gen5.iff',
        WeaponType.POLEARMSABER, 1.0, 6, 'energy')
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('saberHit')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 65
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    lootPoolNames_2 = ['jedi_relic_1']
    lootPoolChances_2 = [100]
    lootGroupChance_2 = 85
    mobileTemplate.addToLootGroups(lootPoolNames_2, lootPoolChances_2,
                                   lootGroupChance_2)

    lootPoolNames_3 = ['powercrystals_hiq']
    lootPoolChances_3 = [100]
    lootGroupChance_3 = 12
    mobileTemplate.addToLootGroups(lootPoolNames_3, lootPoolChances_3,
                                   lootGroupChance_3)

    lootPoolNames_4 = ['random_stat_jewelry']
    lootPoolChances_4 = [100]
    lootGroupChance_4 = 8
    mobileTemplate.addToLootGroups(lootPoolNames_4, lootPoolChances_4,
                                   lootGroupChance_4)

    lootPoolNames_5 = ['sithholocrons']
    lootPoolChances_5 = [100]
    lootGroupChance_5 = 3
    mobileTemplate.addToLootGroups(lootPoolNames_5, lootPoolChances_5,
                                   lootGroupChance_5)

    core.spawnService.addMobileTemplate('dark_jedi_master', mobileTemplate)
Example #29
0
def addTemplate(core):
    mobileTemplate = MobileTemplate()

    mobileTemplate.setCreatureName('gondula_outcast')
    mobileTemplate.setLevel(78)
    mobileTemplate.setDifficulty(0)
    mobileTemplate.setAttackRange(5)
    mobileTemplate.setAttackSpeed(1.0)
    mobileTemplate.setWeaponType(6)
    mobileTemplate.setMinSpawnDistance(3)
    mobileTemplate.setMaxSpawnDistance(5)
    mobileTemplate.setDeathblow(False)
    mobileTemplate.setScale(1)
    mobileTemplate.setSocialGroup('gondula tribe')
    mobileTemplate.setAssistRange(1)
    mobileTemplate.setOptionsBitmask(128)
    mobileTemplate.setStalker(True)

    templates = Vector()
    templates.add('object/mobile/shared_dressed_ewok_f_01.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_02.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_03.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_04.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_05.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_06.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_07.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_08.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_09.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_10.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_11.iff')
    templates.add('object/mobile/shared_dressed_ewok_f_12.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_01.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_02.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_03.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_04.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_05.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_06.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_07.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_08.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_09.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_10.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_11.iff')
    templates.add('object/mobile/shared_dressed_ewok_m_12.iff')

    mobileTemplate.setTemplates(templates)

    weaponTemplates = Vector()
    weapontemplate = WeaponTemplate(
        'object/weapon/melee/unarmed/shared_unarmed_default.iff', 6, 1.0)
    weaponTemplates.add(weapontemplate)
    mobileTemplate.setWeaponTemplateVector(weaponTemplates)

    attacks = Vector()
    mobileTemplate.setDefaultAttack('meleeHit')
    mobileTemplate.setAttacks(attacks)

    lootPoolNames_1 = ['Junk']
    lootPoolChances_1 = [100]
    lootGroupChance_1 = 65
    mobileTemplate.addToLootGroups(lootPoolNames_1, lootPoolChances_1,
                                   lootGroupChance_1)

    lootPoolNames_2 = ['random_loot_primitives']
    lootPoolChances_2 = [100]
    lootGroupChance_2 = 35
    mobileTemplate.addToLootGroups(lootPoolNames_2, lootPoolChances_2,
                                   lootGroupChance_2)

    core.spawnService.addMobileTemplate('gondula_outcast', mobileTemplate)
    return
Example #30
0
def addSpawnArea(core):
    dynamicGroups = Vector()
    dynamicGroups.add('rebel')
    core.spawnService.addDynamicSpawnArea(dynamicGroups, 3689, -6403, 150,
                                          'rori')
    return