Mobile Lua Template Files - Description and Samples

Mobile Lua Template Files - Description and Samples

Typical example of a mobile creature template .Lua file. This was the one created in elpetes sample screenplay





Code:
han_solo_quest = Creature:new {
objectName = "@mob/creature_names:han_solo",
socialGroup = "",
pvpFaction = "",
faction = "",
level = 100,
chanceHit = 1,
damageMin = 645,
damageMax = 1000,
baseXp = 9429,
baseHAM = 24000,
baseHAMmax = 30000,
armor = 0,
resists = {0,0,0,0,0,0,0,0,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 0,
pvpBitmask = NONE,
creatureBitmask = PACK,
optionsBitmask = 264,
diet = HERBIVORE,

templates = {"object/mobile/han_solo.iff"},
lootGroups = {},
weapons = {"han_solo_weapons"},
conversationTemplate = "sample_quest_template",
attacks = {
}
}

CreatureTemplates:addCreatureTemplate(han_solo_quest, "han_solo_quest")

Here is a typical elite creature Lua file.


Code:
acklay = Creature:new {
objectName = "@mob/creature_names:geonosian_acklay_bunker_boss",
socialGroup = "geonosian_creature",
pvpFaction = "geonosian_creature",
faction = "",
level = 157,
chanceHit = 9.25,
damageMin = 935,
damageMax = 1580,
baseXp = 14884,
baseHAM = 960,
baseHAMmax = 1180,
armor = 2,
resists = {40,45,55,55,45,45,40,40,-1},
meatType = "",
meatAmount = 0,
hideType = "",
hideAmount = 0,
boneType = "",
boneAmount = 0,
milk = 0,
tamingChance = 0,
ferocity = 25,
pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY,
creatureBitmask = PACK + KILLER,
optionsBitmask = 128,
diet = CARNIVORE,

templates = {"object/mobile/acklay_hue.iff"},
lootGroups = {
{
groups = {
{group = "acklay", chance = 10000000}
},
lootChance = 8000000
}
},
weapons = {},
conversationTemplate = "",
attacks = {
{"creatureareacombo",""},
{"posturedownattack","postureDownChance=50"}
}
}

CreatureTemplates:addCreatureTemplate(acklay, "acklay")

Here is a typical creature Lua file.


Code:
fambaa = Creature:new {
objectName = "@mob/creature_names:fambaa",
socialGroup = "fambaa",
pvpFaction = "",
faction = "",
level = 34,
chanceHit = 0.41,
damageMin = 315,
damageMax = 340,
baseXp = 3370,
baseHAM = 8700,
baseHAMmax = 10700,
armor = 0,
resists = {20,20,20,20,60,60,-1,-1,-1},
meatType = "meat_reptilian",
meatAmount = 1000,
hideType = "hide_leathery",
hideAmount = 750,
boneType = "bone_mammal",
boneAmount = 675,
milk = 1,
tamingChance = 0.25,
ferocity = 7,
pvpBitmask = ATTACKABLE,
creatureBitmask = PACK + HERD,
optionsBitmask = 128,
diet = CARNIVORE,

templates = {"object/mobile/fambaa.iff"},
lootGroups = {
{
groups = {
{group = "fambaa_common", chance = 3300000}
},
lootChance = 7000000
}
},
weapons = {},
conversationTemplate = "",
attacks = {
{"dizzyattack","dizzyChance=50"},
{"posturedownattack","postureDownChance=50"}
}
}

CreatureTemplates:addCreatureTemplate(fambaa, "fambaa")


List of Variables

Resists - % resist to damage type in following order (-1 for no resist).

(Kinetic, Energy, Blast, Heat, Cold, Electricity, Acid, Stun, Lightsaber)


Ferocity


pvpBitmask (CreatureFlag.h)

Sets the stance of mob

0, NONE, AGGRESSIVE, ATTACKABLE, ENEMY, OVERT, TEF, PLAYER, CHANGEFACTIONSTATUS, BLINK_GREEN. (No idea on the last two).

When using a combination of these stances, format is "pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY"


creatureBitmask

PACK, KILLER, STALKER, HERD, BABY, LAIR, HEALER.


optionsBitmask

128, 264 264 allows conversations to take place


diet

HERBIVORE, CARNIVORE,


templates

This is the path to the .iff file that gives the mob it's appearance. There can be multiple entries here if there are several types of the same kind.


lootGroups


weapons



Example of mob spawned in any of /bin/script/managers/spawn_manager


Code:
{"han_solo_quest",1,4245.38,2,5150.24,284.63,0, "calm", ""},


Back to the top
Free Web Hosting