RFC - Monsters & Uniques

Moderator: EUO Moderators

User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

RFC - Monsters & Uniques

Post by Keighn »

I was considering raising the 2010 post from the dead but decided against it. I've been looking at some old lua rusty/rush/wang sent me years ago. Maybe I can grasp just enough of it to formulate a working idea. I would have liked this to work also with monsters levels (as per pets and various maps) but I don't know exactly how each monster functions at a higher level (ie how much hp they gain, how much damage they do, defense, etc they gain per lvl).

Anyways, this first post will link this: Monsters & Mobs

I also want to explore these ideas again with a little more input:
somewhere wrote:Boss Mobs:
MR 1.5x normal
Intelligence 1.25x normal
HP 2x normal
AS/Damage? 2x normal?
xp 2x normal?
Diablo wrote:Fanatics: Faster speed, -30% Armour class
Beserkers: Damage 4x, To hit 4x, hitpoints x1.5
Ghostly: Half speed, approximately 1/5 chance for cold damage, Resist damage 77%
Possessed: Hit points x12, can't be cursed
Champions: minimum damage x2, maximum damage x2, to hit x2, attack rate 120%, hp x6, level plus 4, experience x3

Extra strong: min damage x3, max damage x3, to hit plus 25%
Extra fast: unique and pack get velocity increase: attack rate x2
Magical resistance: resist all 75% (fire, cold, lightning)
Curse: 50% hits, an amplify damage curse (MLVL/4) on attacker
Fire Enchanted: fire min damage + (min. damage), fire max damage + (max damage), x2 to hit, fire resist (corprse explosion upon death)
Cold Enchanted: cold min damage + (min. damage), cold max damage + (max damage), cold length +20, x2 to hit, cold resist 75% (cold nova upon death)
Lightning Enchanted: lightning min damage + (min. damage), light max damage + (max damage), x2 to hit, lightning resist 75% (charged bolt explosion upon death)
Mana burn: mana min damage + (min damage), mana max damage + (max damage), x2 to hit, magic resist 75%
Spectral Hit: Fire, lightning, cold Resist 20%, x2 to hit (randome fire, cold, lightning, magic, & posion do elemental hit) + (min damage) + ( max damage)
Stone skin: damage resist +80%, ACx3
Multi-shot: two more missiles of the same type are shot
Teleport: (health<33%) or (ranged monster & someone is close); teleport if (health<33%) add +25% of max hp to health
Aura enchanted: might( at monster lvl 4), holy fire( at monster lvl 2), thorns (at monster lvl 4), holy freeze(at monster lvl 2), holy shock(at monster lvl 2), conviction (at monster lvl 4), fanaticism( at monster lvl 4)
Poison strike: hit poisons target
Poison cloud: damage and poisons like poison javelin skill of the amazon
Fire arrow: damage like fire arrow skill of the amazon.
EggMceye wrote:so instead of just 'boss' which you quoted the specs reasonably correctly from memory you could have varying degrees of boss .. hmm interesting, is this rusty's template thing? link to post pls ...

so these boss variants would auto spawn
1/40 reg boxx
1/400 mega boss
1/4000 ultra boss XD whatever, the names are dumb but I get the idea - it's interesting flavour
Rusty wrote:Another way we could get more monsters is by applying a template to the existing ones. Examples of templates are: Lycanthrope, vampire, zombie, lich, skeletal, spectral, shadow, hell, fire. There could also be size templates as well, like small, large, huge, monstrous, etc.

He're basically how these templates would effect the base monster it's applied to. The specifics can be worked out later if necessary.

Lycantrope: (examples: werewolf, wereorc, weretroll, wereminotaur)
attacks with claws instead of normal attack
boost to speed, strength and hit points
lowered defense (as lycans can't use armor properly)
chance of infecting you with lycanthropy

Vampire: (vampire, vampire orc, vampire troll, vampire minotaur)
creature is undead type
has XMP spell or some sort of melee vampyric attack
increase to hit points and defense
summons bat (or some other weak vermin-like creature)

Lich: (lich, orc lich, troll lich, minotaur lich)
creature is undead type
increases hit points, defense and attack strength
only creatures that can do magic and are intelligent can become a lich.
creature is undead type
increase to hit points and defense
gains one or more normal lich spells (OG, KXQ, AEP, KX, WQ, VAM, SL)

Skeletal: (skeleton, skeletal orc, skeletal troll, skeletal minotaur)
creature is undead type
increased hit points, defense and attack strength
winged skeletal monsters can't fly

Zombie: (zombie, zombie orc, zombie troll, zombie minotaur)
creature is undead type
increased hit points ,defense and attack strength
decreased speed (about 50% of the base creature's speed)
decreased inteligence
zombies can't cast spells unless zombie is made from a powerful magical creature then it may have some of it's spells.
possiblilty of causing disease on attack

Spectral: (spectral reaper, spectral orc, spectral troll, spectral minotaur)
creature is undead type
increased hit points, defense and attack strength
creature has the spells IP and SL plus any spells/abilities of the base creature

Shadow: (shadow warrior, shadow orc, shadow troll, shadow minotaur)
greatly increased hit points
one of the following 2 depending if the base creature is a spellcaster type:
non spellcaster type: greatly increased attack strength and magic resistance
spellcaster type: greatly increased defense, inteligence and has one or more of the spells XMP, OG, AEP, WQ, VM in addition to the base creature's spells

Hell: (hellcat, hell orc, hell troll, hell minotaur)
increased hit points, defense, attack strength, inteligence and magic resistance
gains one or more of the spells OG, XMP, KXC, AEP, XC, WQ, VAM, IFH, VF
possibly gains flying ablilty

Fire: (fire dragon, fire orc, fire troll, fire minotaur)
gains the spell IFH and/or VF (like a fire breath or spit attack)
pretty much keeps the same attributes/ablilties as the base creature

Size templates (small, large, huge, monstrous, etc) would basically either increase or decrease the attributes that the monster already posseses. So a small orc would have less hit points, less defense and less attack strength than a normal orc. a large orc would have more hit points, more defense and more attack strength than a normal orc. Possibly the huge or monstrous sizes could have 2x2 or 3x3 avatars.

I realize that having different versions of monsters would mean having to make more avatars for them. Obviously these templates wouldn't be applied to every monster, as some might be too powerful and some just wouldn't make sense (skeletal slime?). This is just a springboard for ideas for new monsters is all. It'd be ok to apply multiple templates to monsters except that there should only be one undead or lycan template applied if one is applied. Though doing this too much would get ridicolus (shadow hell fire orc lich) so I would say 1 or 2 templates at the most.
Keighn wrote:I'll post my thoughts in brackets as I think it would look weird for certain mobs... zombie zombie?

Lycantrope: (examples: werewolf, wereorc, weretroll, wereminotaur)
[Feral]

Vampire: (vampire, vampire orc, vampire troll, vampire minotaur)
[Blood Lusted]

Lich: (lich, orc lich, troll lich, minotaur lich)
[Arcane]

Skeletal: (skeleton, skeletal orc, skeletal troll, skeletal minotaur)
[actually skeletal is pretty good]

Zombie: (zombie, zombie orc, zombie troll, zombie minotaur)
[Plague]

Spectral: (spectral reaper, spectral orc, spectral troll, spectral minotaur)
[Phantasmal or Supernatural] I actually like spectral a lot but again.. Spectral Spectral Reaper?

Shadow: (shadow warrior, shadow orc, shadow troll, shadow minotaur)
[Dark maybe]

Hell: (hellcat, hell orc, hell troll, hell minotaur)
[Infernal]

Fire: (fire dragon, fire orc, fire troll, fire minotaur)
[Burning]

Others:
[Frigid] for Frost/ice
[Toxic] for poison
[Sparking] for electric/lightning
[Reinforced] for heavily armoured
[Dread] for leeching mana

Not sure if you'd use the glowing effect or the tint for like weapons or armour. More than likely not necessary except for that eye-candy excitement people feel when seeing such.

From what recall:
venomous tint-color
vampyric tint-color
copper tint-color
gold tint-color
blackrock tint-color
adamantium tint-color

Should mobs that are of a template type be allowed on boss mobs (ie. Elder skeletal bat)?
Some mobs might look wierd (ie skeletal slime?).
Abilities?
Experience?
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

I know a nasty bit of recycling there and I'll sum it up better. Something to note for those of you who've wandered around the map "Sagitarius." Lots of color tinting and aurus like the phase beasts in there. This is a great idea for possible preprogrammed special mobs that could appear.

I'm also still a fan of a major boss with minions as per diablo and a few other games.
User avatar
eggmceye
hello
Posts: 10577
Joined: Mon Mar 11, 2002 3:55 pm
Location: Sydney, Australia
Contact:

Re: RFC - Monsters & Uniques

Post by eggmceye »

good thread, as it happens spawn-variations (with classic bosses, epic-giants and phase beasts being the core 3) one of the things I'm thinking about atm
Eclips
egg has really fucked this game up :(
Posts: 1131
Joined: Tue Aug 09, 2005 2:06 am
Location: Ohio

Re: RFC - Monsters & Uniques

Post by Eclips »

I think it would be a little cool if you could vary the mobs AI a bit.

Maybe assign 3 AI values, spawners randomly assign a value unless specified.

1:Focuses on pure Damage (XC, XMP, IFH, VF, (V)OG, Melee, etc.)
2: Focuses on Disables (AEP, XJ, INH, IZH, ICE Wind, etc.)
3: Focuses on annoyances (Clone, Summon, AEP, XJ, XM, etc.)

This would add a little more strategy to your party's focus, but I just think it would be cool if you were fighting daemons and one was summoning and keeping people paralyzed while the other hammered away at your health.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

I'll get to some basic lua I've been shown in a bit. From what pets have shown me mobs act differently a little based on intelligence and spells they have. You want a deadly mob then look at comparison between balrons and evil bunnies. Both are nasty but those bunnies are fast as hell.

Sagitarus (sp) is an awesome map that should be explored for ideas.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

LUA Sent to Me

Post by Keighn »

OK, as promised as I really want to make some basic mobs with lua:
Rusty wrote:Simple monster modification in LUA

Open notepad so you can type the function. The file should be saved in the scripts.map folder with the map number and map name as the filename and with a lua for the extension (example "lost jungle 217.lua) In the file you need the write a function for your modded mob. The function name should be unique as possible so there is no duplication with existing functions. A good rule of thumb that I use is to put the initals of the map I'm working on at the beginning of the function name. Example:

Code: Select all

function lj_super_mob(m) -- note the lj at the beginning of the function name (for Lost Jungle)

   -- anything after --'s are comments. please comment your code so other people can understand it.

   -- this is where the code to modify your monster goes. See below for specifics on that.

end -- this ends your function
The 'm' in parenthesis represents the monster that you are modifying. Any letter or word could be used in place of the 'm' but I usually use 'm'. It's important because it's used in all the functions that modify the monster.

The simplest way to improve monsters is to change their level. You can do that using the following:

set_monster_level(m,level)

where level is what level you want the monster to be. This function will only increase HP, AS, Def and XP according to the level but it doesn't raise Int or give new spells or abilities or adjust the monster's drops.

You can directly change specific attributes of a mob. There are several functions for that. Here is a list of most of them:
Where 'number' appears below you should put in a numeric value.
where 'string' appears below you should put in some alphanumeric text in quotes. ("like this")

m:set_name(string) - this names the mob. string is the name you want in quotes (example: "Super Mob")
m:set_hp_max(number) -- this sets the mob's max hp to a specific value
m.hp = number -- this sets the mob's current hp
m:set_magic_resistance(number) -- this sets the mob's magic resistance
m:mk_boss() -- this will make a mob a boss. Note that there is no 'm' in the parenthesis
m.code = number -- this sets the code or avatar for the monster. Refer to maped for the numbers for different monsters. Dont forget to prefix the hex numbers for the monster code with 0x (example: 0x25e)
m.speed = number -- this sets the mob's speed. lower the number the faster the mob. look at the numbers in the monsters.txt file in the sdat folder to get a feel for this. numbers range anywhere from 200 to 1000. This may or may not be changeable, i'm not sure.
m:set_intel(number) -- this sets the mob's int.
m.mana = number -- this sets the mob's current mana amount.
m:set_thaco(number) -- this sets the mob's AS.
m:set_base_AC(number) -- this sets the mob's defense.
m:set_dmg_dice(number) -- this sets the first number of a mob's damage (in XdY format)
m:set_dmg_sides(number) -- this sets the second number of a mob's damage (in XdY format)
m:set_align(alignment) -- alignment can be either ALIGN_GOOD, ALIGN_NEUTRAL or ALIGN_EVIL. As expected, this changes the mob's alignment.
m.xp_kill = number -- this sets the XP for the mob.
m.immune_to_glassing = true -- this make the mob immune to glass weapons. Change the true to false to make the mob effected by glass weapons again.
m.large=true -- this makes a mob 2x2 in size. change true to false to make them normal again.
m.immobile=true -- this makes a mob immobile or if set to false instead of true makes an immobile monster mobile.
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m.aquatic -- this makes a mob able to cross on water or if set to false, unable to cross on water. I think that if this is set to true the mob cant walk on land.
m:unlearn_spells() -- this wipes the knowledge of all spells from a mob. Useful for getting a clean start before giving spells to a mob.
m:learn_spell(string) -- this gives a mob the ability to cast a specific spell. string is the letters for the spell in quotes ("XMP", "XC", etc)
m.treasure = number -- this sets the treasure code for the mob. it's best to look at the treasure column in the monster.txt file and copy a value from there for this. dont forget to prefix the hex number with 0x (example: 0x9311a).

There are other things but they generally aren't needed unless you are doing something complicated.

in order to use your function, you have to put the name of your function in the script spot on the monster spawner in maped. Do not include the parenthesis or the 'm'. once you do that all the monsters spawned by that spawner will use the function you made and be modified. Note that the spawner can be any type of monster or monster group.

Here is an example of a complete function to make a super mob or mobs depending on the spawner:

Code: Select all

function lj_super_mob(m)

   set_monster_level(m,100) -- make the mob level 100
   m:set_hp_max(200) -- set his max hp to 200
   m.hp = 200 -- set his current hp to 200
   m:set_base_ac(50) -- set his def to 50
   m.large = true -- make him 2x2
   m:set_intel(300) -- set his intelligence to 300
   m.mana = 300 -- set his mana to 300
   m:unlearn spells() -- unlearn any spells he might have.
   m:learn_spell("xmp") -- give him XMP
   m:learn_spell("XC") -- give him XC
   m.treasure = 0x7311a -- set his treasure code to one that drops better.
   m.xp_kill = 500 -- set his XP to 500

end

That's it! If you have questions about this let me know.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function mob_name(m) -- in the script line inside of the monster you would type exactly: mob_name to attach this to it

m:set_name("Super Mob UBERNESS") --Sets mob name -- if left blank mob would just have its regular name
m.xp=m.xp * 2.0; --Sets mob xp to x2
m:set_align(ALIGN_EVIL) --Sets mob allignment to evil for good mobs
m:set_hp_max(m:get_hp_max()*2.0); --Sets mob max hp x2
m:set_intel(m:get_intel()*2.0); --Sets mob intelligence x2
m:set_dmg_dice(m:get_dmg_dice()*2.0); --Sets mob dmg dice rolls x2
m:set_dmg_sides(m:get_dmg_sides()*2.0); --Sets mob dmg dice sides x2
m:set_thaco(m:get_thaco()*2.0); --Sets mob AS x2
m:set_base_ac(m:get_base_ac()*2.0); --Sets mob AC x2
m:learn_spell("og2") --Lets mob learn "og2" spell to cast

end

-- OR

function mob_name(m)

m.xp=100 --Sets mob xp to 100
m:set_align(ALIGN_EVIL) --Sets mob allignment to evil for good mobs
m:set_hp_max(500) --Sets mob max hp AT 500
m:set_mana_max(m:get_mana_max()*2.0); --Sets mob mana x2 and is basically pointless since mobs have infinite mana
m:set_intel(250) --Sets mob intelligence to 250
m:set_dmg_dice(8) --Sets mob dmg dice rolls to 8
m:set_dmg_sides(8) --Sets mob dmg dice sides to 8
m:set_thaco(35) --Sets mob AS to 35
m:set_base_ac(25) --Sets mob AC to 25
m:learn_spell("og2") --Lets mob learn "og2" spell to cast
m.mana=100; --Required to set mana if mob wouldnt already have some (so they can cast)
end


m:set_magic_resistance(m:get_magic_resistance()*2.0); --sets mob magic resis

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

SUPER COW
--- event_mobs_super_cow.lua
--- by Rusty Patterson 6/20/08

-- Appears to be an ordinary cow until attacked. When attacked it attacks with powerful magic and melee attacks. If it loses sight of it's target the cow reverts back to neutral alignment. It does not show evidence of the damage it's taken (always looks fully healed)

require ("funcs")

-- START SUPER COW

function super_cow_init(m)

m:unlearn_spells()
m:set_magic_resistance(1000)
m:set_align(ALIGN_NEUTRAL)
m:set_hp_max(200000)
m:set_intel(5000)
m:set_dmg_dice(100)
m:set_dmg_sides(3)
m:set_thaco(1000)
m:set_base_ac(55)
m:learn_spell("vam")
m:learn_spell("ivpy")
m:learn_spell("wq")
m:learn_spell("og2")
m:learn_spell("xc")
m:learn_spell("ip2")
m:learn_spell("ijo")
m:learn_spell("vf")
m:learn_spell("aep")
m:learn_spell("xj")
m.xp_kill=50000
m.mana=5000
m.immune_to_glassing=true;
m.death_func="super_cow_dies";
m.heartbeat_func="super_cow_actions";

end


function super_cow_dies(m) --- give all the players nearby 10K gold

sx=m.x-6
ex=m.x+6
sy=m.y-6
ey=m.y+6
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and ptr.hp>0) then
item = 0x100
give_item(ptr.id,item,10000)
end
end
end

end


function super_cow_actions(m) --- if cow has a target it becomes large and attacks, if it doesn't it turns back small and goes neutral.

m:set_health(HN_WOUNDED,0) -- no bleeding
m:set_hp_max(m.hp) --- make health bar of mob not decrease, but hp decreases

if m.target_id < 0 then -- turn back neutral if no target
m:set_align(ALIGN_NEUTRAL)
m:set_health(HN_SPEEDY,0) -- slow him back down
m.large=false
update_everyones_fov(m)
else
m:set_health(HN_TURNED,0) -- keep cow from fleeing
m:set_health(HN_SPEEDY,5) -- make him fast
m.large=true
update_everyones_fov(m)
end

end

-- END SUPER COW
MINOTAUR LORD
--- event_mods_minotaur_lord.lua
--- by Rusty Patterson, 06/09/08

-- This is an extremely powerful minotaur that summons hordes of minotaurs then rises as a lich when it dies.

-- START MINOTAUR LORD

function minotaur_lord_init(m)

m:unlearn_spells()
m:set_magic_resistance(5000)
m:set_name("Minotaur Lord")
m:set_align(ALIGN_EVIL)
m:set_hp_max(15000)
m:set_intel(1500)
m:set_dmg_dice(50)
m:set_dmg_sides(3)
m:set_thaco(75)
m:set_base_ac(50)
m:learn_spell("xmp")
m:learn_spell("ivpy")
m:learn_spell("wq")
m:learn_spell("xvm")
m:learn_spell("og2")
m.xp_kill=15000
m.immune_to_glassing=true;
m.death_func="minotaur_lord_dies";
m.heartbeat_func="minotaur_lord_actions";

end


function minotaur_lord_dies(m)

mc=spawn_at(0x209,m.x,m.y,m.map_level)
minotaur_lich_init(mc)
local_msg(m,"The Minotaur Lord rises as a lich!")

end


function minotaur_lord_actions(m)

x = math.random(1,100)
if x == 1 and m.target_id>=0 then --- regular minotaurs
mc=spawn_at(0x235,m.x+1,m.y-1,m.map_level)
mc=spawn_at(0x235,m.x+1,m.y+1,m.map_level)
mc=spawn_at(0x235,m.x-1,m.y-1,m.map_level)
mc=spawn_at(0x235,m.x-1,m.y+1,m.map_level)
local_msg(m,"The Minotaur Lord summons minotaurs!")
end
if x == 2 and m.target_id>=0 then --- mino shamans
mc=spawn_at(0x236,m.x+1,m.y-1,m.map_level)
mc=spawn_at(0x236,m.x+1,m.y+1,m.map_level)
mc=spawn_at(0x236,m.x-1,m.y-1,m.map_level)
mc=spawn_at(0x236,m.x-1,m.y+1,m.map_level)
local_msg(m,"The Minotaur Lord summons minotaur shamans!")
end
if x == 3 and m.target_id>=0 then --- mino chiefs
mc=spawn_at(0x237,m.x+1,m.y-1,m.map_level)
mc=spawn_at(0x237,m.x+1,m.y+1,m.map_level)
mc=spawn_at(0x237,m.x-1,m.y-1,m.map_level)
mc=spawn_at(0x237,m.x-1,m.y+1,m.map_level)
local_msg(m,"The Minotaur Lord summons minotaur chieftains")
end
if x == 4 and m.target_id>=0 then --- minotaur acolytes
mc=spawn_at(0x236,m.x+1,m.y-1,m.map_level)
minotaur_acolyte_init(mc)
mc=spawn_at(0x236,m.x+1,m.y+1,m.map_level)
minotaur_acolyte_init(mc)
mc=spawn_at(0x236,m.x-1,m.y-1,m.map_level)
minotaur_acolyte_init(mc)
mc=spawn_at(0x236,m.x-1,m.y+1,m.map_level)
minotaur_acolyte_init(mc)
local_msg(m,"The Minotaur Lord summons Minotaur Acolytes!")
end
if x == 5 and m.target_id>=0 then --- minotaur warriors
mc=spawn_at(0x237,m.x+1,m.y-1,m.map_level)
minotaur_warrior_init(mc)
mc=spawn_at(0x237,m.x+1,m.y+1,m.map_level)
minotaur_warrior_init(mc)
mc=spawn_at(0x237,m.x-1,m.y-1,m.map_level)
minotaur_warrior_init(mc)
mc=spawn_at(0x237,m.x-1,m.y+1,m.map_level)
minotaur_warrior_init(mc)
local_msg(m,"The Minotaur Lord summons Minotaur Warriors!")
end

end

-- END MINOTAUR LORD


-- START MINOTAUR ACOLYTE

function minotaur_acolyte_init(m)

m:unlearn_spells()
m:set_magic_resistance(1000)
m:set_name("Minotaur Acolyte")
m:set_align(ALIGN_EVIL)
m:set_hp_max(500)
m:set_intel(1000)
m:set_dmg_dice(15)
m:set_dmg_sides(3)
m:set_thaco(35)
m:set_base_ac(30)
m:learn_spell("xmp")
m:learn_spell("ivpy")
m:learn_spell("wq")
m:learn_spell("xvm")
m:learn_spell("qp")
m.xp_kill=700

end

--- END MINOTAUR ACOLYTE


--- START MINOTAUR WARRIOR

function minotaur_warrior_init(m)

m:unlearn_spells()
m:set_magic_resistance(500)
m:set_name("Minotaur Warrior")
m:set_align(ALIGN_EVIL)
m:set_hp_max(1000)
m:set_intel(250)
m:set_dmg_dice(25)
m:set_dmg_sides(3)
m:set_thaco(75)
m:set_base_ac(40)
m.xp_kill=700

end

--- END MINOTAUR WARRIOR


--- START MINOTAUR LICH

function minotaur_lich_init(m)

m:unlearn_spells()
m:set_magic_resistance(5000)
m:set_name("Minotaur Lich")
m:set_align(ALIGN_EVIL)
m:set_hp_max(10000)
m:set_intel(2500)
m:set_dmg_dice(50)
m:set_dmg_sides(3)
m:set_thaco(75)
m:set_base_ac(50)
m:learn_spell("xmp")
m:learn_spell("aep")
m:learn_spell("wq")
m:learn_spell("XC")
m.xp_kill=15000
m.immune_to_glassing=true;
m.death_func="minotaur_lich_dies";
m.heartbeat_func="minotaur_lich_actions";

end

function minotaur_lich_dies(m)

local_msg(m,"The Minotaur Lich is defeated!")

end

function minotaur_lich_actions(m)

if math.random(1,30) == 1 then -- hit everything in sight with lightning
sx=m.x-6
ex=m.x+6
sy=m.y-6
ey=m.y+6
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
spell_lightning_bolt_autotarget("og2",m,ptr,false,0,0,"6d4 + intelligence /20")
local_msg(m,"The Minotaur Lich unleashes a fury of lightning bolts!")
end
end
end
end

end

--- END MINOTAUR LICH
INVISIBLE STALKER
--- event_mobs_invisible_stalker.lua
--- by Rusty Patterson 6/22/08

-- An assassin that moves around and attacks people while invisible. Only visible the brief moment he attacks or by truesight scroll.

require ("funcs")

-- START INVISIBLE STALKER

function invisible_stalker_init(m)

m:unlearn_spells()
m:set_name("Invisible Stalker")
m:set_magic_resistance(1000)
m:set_align(ALIGN_EVIL)
m:set_hp_max(10000)
m:set_intel(100)
m:set_dmg_dice(200)
m:set_dmg_sides(3)
m:set_thaco(100)
m:set_base_ac(22)
m.xp_kill=5000
m.immune_to_glassing=true;
m.death_func="invisible_stalker_dies";
m.heartbeat_func="invisible_stalker_actions";

end


function invisible_stalker_dies(m) --- give all the players nearby 1K gold

sx=m.x-6
ex=m.x+6
sy=m.y-6
ey=m.y+6
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and ptr.hp>0) then
item = 0x100
give_item(ptr.id,item,1000)
end
end
end

end


function invisible_stalker_actions(m)

m:set_health(HN_INVISIBLE,5) -- always invisible
m:set_health(HN_SPEEDY,5) -- fast
update_everyones_fov(m)
end

-- END INVISIBLE STALKER
INFERNO DRAGON
--- event_mobs_inferno_dragon.lua
--- by Rusty Patterson, 07/3/08

-- A fire dragon with an awesome breath attack and a blinding attack. Explodes when it dies.

-- START INFERNO DRAGON

function inferno_dragon_init(m)

m:unlearn_spells()
m:set_magic_resistance(700)
m:set_name("Inferno Dragon")
m:set_align(ALIGN_EVIL)
m:set_hp_max(50000)
m:set_intel(5000)
m.mana = 5000
m:set_dmg_dice(75)
m:set_dmg_sides(2)
m:set_thaco(200)
m:set_base_ac(33)
m:learn_spell("vf")
m.xp_kill=20000
m.immune_to_glassing=true
m.death_func="inferno_dragon_dies"
m.heartbeat_func="inferno_dragon_actions"

end

function inferno_dragon_actions(m) -- Breathes an awesome breath attack and sometimes flashes brightly causing blindness.

m:set_health(HN_WOUNDED,0) -- anti cleave

--- blinding flash of light
if math.random(1,20) == 1 and m.target_id>=0 then
local_msg(m,"The Inferno Dragon glows with intense light!")
spell_turn("axc",m)
sx=m.x-2
ex=m.x+3
sy=m.y-2
ey=m.y+3
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
ptr:set_health(HN_BLIND,5)
update_fov(ptr.id)
send_message(ptr.id,"You are blinded!")
end
end
end
end

--- awesome breath attack
if math.random(1,30) == 1 and m.target_id >= 0 then
local_msg(m,"The Inferno Dragon breathes fire!")
ptr = get_sent_ptr(m.target_id)
x = ptr.x - m.x ---- find the direction of the target
y = ptr.y - m.y
dr = math.deg(math.atan2(y,x))
agls = 45
for d = 1, 5 do --- only shoot fireballs over a 90 degree angle in the direction of the target
for a = (dr - agls), (dr + agls), agls / (2 ^ (d-1)) do
xx = m.x + d * math.cos(math.rad(a))
yy = m.y + d * math.sin(math.rad(a))
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
spell_fireball("vf",m,ptr,false,0,0,"7d7 + intelligence /30")
hurt(ptr.id, math.random(100,150), "dragon breath")
end
end
end
end

end

function inferno_dragon_dies(m) --- Explodes violently when he dies, drops glowing embers

-- explodes hitting everyone in range
local_msg(m,"The Inferno Dragon Explodes!")
-- simple_send_event(m.id, 26); not working
send_event(m.map_level,-1,m.x,m.y,26,0); -- 26 is explosion
agls = 45
for d = 1, 5 do
for a = 0, 360, agls / (2 ^ (d-1)) do
xx = m.x + d * math.cos(math.rad(a))
yy = m.y + d * math.sin(math.rad(a))
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
spell_fireball("vf",m,ptr,false,0,0,"7d7 + intelligence /30")
hurt(ptr.id, math.random(200,250), "the explosion")
end
end
end

-- drop a bunch of glowing embers randomly in a circle :)
agls = 45
map=get_map_ptr(m.map_level)
for d = 1, 5 do
for a = 0, 360, agls / (2 ^ (d-1)) do
xx = m.x + d * math.cos(math.rad(a))
yy = m.y + d * math.sin(math.rad(a))
if math.random(1,5) == 1 then
map:add_item(xx,yy,1,0x52e,true)
end
end
end

end

-- END INFERNO DRAGON
GIANT GOLEM
--- event_mobs_giant_golem.lua
--- by Rusty Patterson, 06/10/08

-- A large and very powerful giant iron golem.

-- START GIANT GOLEM

function giant_golem_init(m)

m:unlearn_spells()
m:set_magic_resistance(10000)
m:set_name("Giant Golem")
m:set_align(ALIGN_EVIL)
m:set_hp_max(200000)
m:set_intel(10)
m:set_dmg_dice(75)
m:set_dmg_sides(2)
m:set_thaco(200)
m:set_base_ac(25)
m.xp_kill=10000
m.immune_to_glassing=true;
m.death_func="giant_golem_dies";
m.heartbeat_func="giant_golem_actions";
m.large=true;

end

function giant_golem_actions(m) -- stomps the ground causing an earthquake every so often. Players standing next to the golem get hurt from the shockwave.

m:set_health(HN_WOUNDED,0) -- anti cleave
if math.random(1,50) == 1 and m.target_id>=0 then
local_msg(m,"The Giant Golem stomps the ground!")
sx=m.x-1
ex=m.x+2
sy=m.y-1
ey=m.y+2
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
spell_earthquake("ivpy",m)
hurt(ptr.id, math.random(150,200), "the shockwave")
end
end
end
end
end

function giant_golem_dies(m) --- drops ingots and a golem power crystal when he dies.

sx=m.x-1
ex=m.x+1
sy=m.y-1
ey=m.y+1
for yy=sy,ey do
for xx=sx,ex do
ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
map=get_map_ptr(m.map_level)
map:add_item(xx,yy,math.random(1,20),0x118,true)
end
end
map:add_item(m.x,m.y,1,0x432,true)
local_msg(m,"The Giant Golem falls to pieces!")

end


-- END GIANT GOLEM
EVIL SLIME
--- event_mods_slime.lua
--- by Rusty Patterson, 06/06/08

-- This is an powerful slime that splits multiple times.

---require("funcs")

-- START EVIL SLIME

function evil_slime_init(m)

m:unlearn_spells()
m:set_magic_resistance(5000)
m:set_name("Evil Slime")
m:set_align(ALIGN_EVIL)
m:set_hp_max(10000)
m:set_intel(10)
m:set_dmg_dice(25)
m:set_dmg_sides(3)
m:set_thaco(50)
m:set_base_ac(50)
m.xp_kill=10000
m.immune_to_glassing=true;
m.death_func="evil_slime_dies";
m.large=true;

end

function evil_slime_dies(m)

--- Evil Slime splits into somewhat unevenly powered pieces

mc=spawn_at(0x21a,m.x+2,m.y,m.map_level)
strong_slime_init(mc,math.random(10,25))
mc=spawn_at(0x21a,m.x-2,m.y,m.map_level)
strong_slime_init(mc,math.random(10,25))
mc=spawn_at(0x21a,m.x,m.y+2,m.map_level)
strong_slime_init(mc,math.random(10,25))
mc=spawn_at(0x21a,m.x,m.y-2,m.map_level)
strong_slime_init(mc,math.random(10,25))
update_everyones_fov(mc)
local_msg(m,"The Evil Slime splits!")

end

-- END EVIL SLIME

--- START STRONG SLIME
--- these slimes are spawned at variable strengths
--- pct is a value from 1 to 100

function strong_slime_init(m,pct)

m:unlearn_spells()
m:set_magic_resistance(5000*pct/100)
m:set_align(ALIGN_EVIL)
m:set_hp_max(10000*pct/100)
m:set_intel(10)
m:set_dmg_dice(15)
m:set_dmg_sides(3)
m:set_thaco(25)
m:set_base_ac(25)
m.xp_kill = 10000*pct/100
m.immune_to_glassing=true
m.death_func="strong_slime_dies"

end

function strong_slime_dies(m)

if m.xp_kill > 250 then --- if the xp for killing the strong slime is > 250 then the slime splits into 2 half as powerful slimes.
mc=spawn_at(0x21a,m.x,m.y,m.map_level)
strong_slime_init(mc,100*m.xp_kill/10000/2)
mc=spawn_at(0x21a,m.x,m.y,m.map_level)
strong_slime_init(mc,100*m.xp_kill/10000/2)
update_everyones_fov(mc)
local_msg(m,"The slime splits!")
end
end

-- END STRONG SLIME
HUGE CRAB
-- HUGE CRAB
-- large crab, big attacks
-- when gets lowish hp he stops and regens

gHugeCrabMaxhp=10000
gHugeCrabDef=30
gHugeCrabMr=500
gHugeCrabAlive=0

function huge_crab_init(m)




m:set_name("Huge Crab")
m:set_hp_max(gHugeCrabMaxhp)
m.hp=gHugeCrabMaxhp
m.mana=100
m.heartbeat_func="huge_crab_heartbeat"
m:set_thaco(100)
m:set_dmg_dice(7)
m:set_dmg_sides(7)
m:set_magic_resistance(gHugeCrabMr)
m:set_base_ac(gHugeCrabDef)
m.large=true -- crab needs to step before map updated properly
m.morale=0
gHugeCrabAlive=1

end



-- HN_SICK is used to not make the crab heal itself so soon after healing
-- crab is marked as sick after healing

function huge_crab_heartbeat(m)

-- heal
-- when under 40% health and haven't healed for 10 sec
if m.hp<gHugeCrabMaxhp*0.4 and m:get_health(HN_MEDITATING)==0 and m:get_health(HN_SICK)==0 then

local_msg(m,"The huge crab hides in his shell and rests for a while!")
m:set_health(HN_MEDITATING,10)
m:set_health(HN_HELD,-1) -- appear to be held
m:set_base_ac(500)
m:set_magic_resistance(10000)
end

if m:get_health(HN_MEDITATING)~=0 then
heal(m.id,gHugeCrabMaxhp/20)
end

if m:get_health(HN_MEDITATING)~=0 and m.hp>=gHugeCrabMaxhp or m:get_health(HN_MEDITATING)==1 then
m:set_health(HN_MEDITATING,0)
m:set_health(HN_HELD,0)
m:set_base_ac(gHugeCrabDef)
m:set_magic_resistance(gHugeCrabMr)

local_msg(m,"The huge crab is awake again!")
spell_earthquake("ivpy",m)
m:set_health(HN_SICK,10)
end

-- spawn some crablings only I have a target
if int_rand(10)==1 and m.target_id>=0 then

mc=spawn_near_id(0x262, m.id)
if mc~=nil then
local_msg(m,"A crabling is spawned!")
end
end

end

-- END HUGE CRAB
Last edited by Keighn on Wed May 08, 2013 5:20 am, edited 2 times in total.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Some Lost Jungle Script

Post by Keighn »

Scripts for Improving Lost Jungle Mosnters
-- script for improving monsters



function lj_improve_mob(m)

if m.code == 0x200 or m.code == 0x20d or m.code == 0x20f or m.code == 0x228 then

-- goblins
set_monster_level(m, 25 + ((m:get_hp_max() - 6) * 10) / (15 - 6) + math.random(-2, 2))
m.treasure = 0x5311a
elseif m.code == 0x201 or m.code == 0x20e or m.code == 0x226 or m.code == 0x227 or m.code == 0x2a0 then

-- orcs
set_monster_level(m, 35 + ((m:get_hp_max() - 8) * 10) / (25 - 8) + math.random(-2, 2))
m.treasure = 0x6311a
else

-- everything else
set_monster_level(m, 45 + ((m:get_hp_max() - 20) * 10) / (90 - 20) + math.random(-2, 2))
m.treasure = 0x7311a
end
if m.code == 0x20d or m.code == 0x20e or m.code == 0x21e then

-- magic using mobs
m:set_intel(m:get_hp_max())
m.mana = m:get_intel()
m:set_hp_max(m:get_hp_max() * 0.75)
m.hp = m:get_hp_max()
if m.code == 0x20d or m.code == 0x20e then
m:learn_spell("xmp")
m:learn_spell("wq")
end
end

end
Scripts of Boss Orc
-- scripts for the boss goblin, orc and snow ettin



function lj_boss_orc(m)

set_monster_level(m,65 + math.random(0,10))
m.treasure = 0x8311a
m.large = true

end


Scripts for Boss Snow Ettin
function lj_boss_snow_ettin(m)

set_monster_level(m,75 + math.random(0,10))
m.treasure = 0x9311a
m.large = true

end

Script for Boss Goblin
function lj_boss_goblin(m)

set_monster_level(m,55 + math.random(0,10))
m.treasure = 0x7311a
m.large = true

end
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

Sadly I don't know the lua for the other weird mobs. I posted those as examples for people to dissect and take what they will for creating their own special mobs. Now with all the preliminary info out of the way we can actually start looking at what we want to do with mobs individually. For use with maped. I'll try to figure out something small. I'll post a regular mob then a mob of how I'd put it in a particular map and what I want it to do. Then I'll post my best attempt at luaing it. I do hope others will try this as well. Sorry I don't have the codes for Mothra and some of the others as they have some unique abilities. Perhaps eventually someone will itemize each ability for easy of insertion into a mob.

The other ideas for special random mobs I hope we can also discuss.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

A long time ago I created an alteration off of the Menzter D&D creature toughness rules for making weaker or tough mobs:

I'll post he entire list and its short. I doubt we'll use the weaker scale although I might use it for my own lua mobs if I get the chance:

Monsters ---------- Humanoids ---- bonus/penalty
Feeble ------------ Inferior --------- -5 penalty
Meek -------------- Squalid ---------- -4 penalty
Puny -------------- Paltry ----------- -3 penalty
Weak ------------- Meager ---------- -2 penalty
Vulnerable ----- Shoddy ------------ -1 penalty
--------Normal/average -----------------
Fierce ----------- Skilled ---------- +1 bonus
Powerful --------- Elite ------------- +2 bonus
Vicious --------- Expert ----------- +3 bonus
Brutal ------- Famed ---------- +4 bonus
Savage ------- Master ---------- +5 bonus (power was from Sword of Fargoal mobs too powerful for you)

Now for me to think of how to apply this to the game. Simplest is bosses retain their current random naming (ie. Skyfox bullhorn or w/e). The extra toughness is added as a suffix of sorts. (xingel bloodmutt the brutal, elder xorn the savage)

==========
Normal Boss Mobs:
10% chance it spawns with 1-6 underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 1.5x normal
Intelligence 1.25x normal
HP 2x normal
AS/Damage: 1.25x normal
XP: 2x normal

Fierce/Skilled Boss Mobs:
10% chance it spawns with 1-6 "Elder" underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 1.75x normal
Intelligence 1.5x normal
HP 2.5x normal
AS/Damage: 1.5x normal
XP: 2.5x normal

Powerful/Elite Boss Mobs:
10% chance it spawns with 1-6 "Fierce/Skilled" underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 2x normal
Intelligence 1.75x normal
HP 3x normal
AS/Damage: 1.75x normal
XP: 3x normal

Vicious/Expert Boss Mobs:
10% chance it spawns with 1-6 "Powerful/Elite" underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 2.25x normal
Intelligence 2x normal
HP 3.5x normal
AS/Damage: 2x normal
XP: 3.5x normal

Brutal/Famed Boss Mobs:
10% chance it spawns with 1-6 "Vicious/Expert" underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 2.5x normal
Intelligence 2.25x normal
HP 4x normal
AS/Damage: 2.25x normal
XP: 4x normal

Savage/Master Boss Mobs:
10% chance it spawns with 1-6 "Brutal/Famed" underlings (labeled in Red) They drop regular gold (and if like a slime or such maybe ooze)
MR 2.75x normal
Intelligence 2.5x normal
HP 4.5x normal
AS/Damage: 2.5x normal
XP: 4.5x normal

Next time Templates:
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

First here's the Wisp Info which will make no sense:
#code code dec name algin cls HP AS AC dmg sight speed treas Morale xp spwnwt it rangd pois undead flying water immob disease vamp lycan mwalk lava organic slots INT MR tamability foodgroup favfood evolve spells avg dmg

255 597 wisp e a 20 15 18 2d6 4 600 0 18 55 2 40b 0 n n y n n n n n n n y 1 100 50 0 c 0 0 gp:ip2:aep 6

Simple Will-o-Wisp Modification:
Wisp 1.png
function Will-o-wisp(m)

m:set_hp_max(250) -- set his max hp to 250
m.hp = 250 -- set his current hp to 250
m:set_base_ac(150) -- set his def to 150
m:set_magic_resistance(800)
m:set_dmg_dice(8)
m:set_dmg_sides(3)
m:set_thaco(50)
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m:set_intel(25) -- set his intelligence to 25
m.mana = 25 -- set his mana to 25
m:unlearn spells() -- unlearn any spells he might have.
m:learn_spel("vsl") -- give him improved invisibility
m:learn_spell("ip") -- give him blink
m:learn_spell("og2") -- give him lightning
m:learn_spell("aep") -- gives him paralyse
m:learn_spell("izh") -- gives him sleeping wind
m.treasure = 0x7311a -- set his treasure code to one that drops better.
m.xp_kill = 300 -- set his XP to 300 I just messed with it as I don't know what the hell to set this as

end

Dark Light Version:
Wisp 1 Dark Light.png
function Dark_Light(m)

m:set_hp_max(50) -- set his max hp to 50
m.hp = 50 -- set his current hp to 50
m:set_base_ac(50) -- set his def to 50
m:set_magic_resistance(200)
m:set_dmg_dice(6)
m:set_dmg_sides(5)
m:set_thaco(30)
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m:set_intel(250) -- set his intelligence to 250
m.mana = 250 -- set his mana to 250
m:unlearn spells() -- unlearn any spells he might have.
m:learn_spel("vsl") -- give him improved invisibility
m:learn_spell("ip") -- give him blink
m:learn_spell("xc") -- give him death spell
m:learn_spell("aep") -- gives him paralyse
m:learn_spell("ijo") -- gives him mana burn
m.treasure = 0x7311a -- set his treasure code to one that drops better.
m.xp_kill = 350 -- set his XP to 350 I just messed with it as I don't know what the hell to set this as

end

Swamp Gas:
Wisp 1 venomous.png
function Swamp_Gas(m)

m:set_hp_max(35) -- set his max hp to 35
m.hp = 35 -- set his current hp to 35
m:set_base_ac(80) -- set his def to 80
m:set_magic_resistance(200)
m:set_dmg_dice(2)
m:set_dmg_sides(9)
m:set_thaco(25)
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m.pois=true -- i'm guess here hoping this makes the mob poisonous please correct if not
m.disease=true -- again i'm guessing about inflicting disease :/
m:set_intel(600) -- set his intelligence to 600
m.mana = 600 -- set his mana to 600
m:unlearn spells() -- unlearn any spells he might have.
m:learn_spell("ip") -- give him blink
m:learn_spell("inh") -- give him poison wind
m:learn_spell("aep") -- gives him paralyse
m:learn_spell("izh") -- gives him sleeping wind
m.treasure = 0x7311a -- set his treasure code to one that drops better.
m.xp_kill = 150 -- set his XP to 150 I just messed with it as I don't know what the hell to set this as

end


Volt:
Wisp 1 Volt or Bzzap.png
function Volt(m)

m:set_hp_max(100) -- set his max hp to 100
m.hp = 100 -- set his current hp to 100
m:set_base_ac(150) -- set his def to 150
m:set_magic_resistance(400)
m:set_dmg_dice(10)
m:set_dmg_sides(4)
m:set_thaco(40)
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m:set_intel(200) -- set his intelligence to 200
m.mana = 20 -- set his mana to 200
m:unlearn spells() -- unlearn any spells he might have.
m:learn_spell("ip") -- give him blink
m:learn_spell("og2") -- give him lightning
m:learn_spell("vog") -- gives him chain lightning
m:learn_spell("aep") -- gives him paralyse
m.treasure = 0x7311a -- set his treasure code to one that drops better.
m.xp_kill = 400 -- set his XP to 400 I just messed with it as I don't know what the hell to set this as

end

Hell Lantern:
Wisp 1 Hell Lantern.png
function Hell_Lantern(m)

m:set_hp_max(150) -- set his max hp to 150
m.hp = 150 -- set his current hp to 150
m:set_base_ac(50) -- set his def to 50
m:set_magic_resistance(300)
m:set_dmg_dice(3)
m:set_dmg_sides(11)
m:set_thaco(70)
m.flying=true -- this makes a mob able to fly or if set to false instead of true makes an monster unable to fly.
m:set_intel(450) -- set his intelligence to 450
m.mana = 450 -- set his mana to 450
m:unlearn spells() -- unlearn any spells he might have.
m:learn_spel("vf") -- give him fire ball
m:learn_spell("fg") -- give him flame strike
m:learn_spell("ip") -- gives him blink
m:learn_spell("ifh") -- gives him fire wind
m.treasure = 0x7311a -- set his treasure code to one that drops better.
m.xp_kill = 300 -- set his XP to 300 I just messed with it as I don't know what the hell to set this as

end


Really don't have a lot of that set up and its so untested but that's an example. Wanted Hell lantern to explode upon death but didn't care to deconstruction inferno dragons code. Really not sure sure on many unique monster abilities. Some one please correct the mistakes and determine how bad those are as I was just making a random post.
You do not have the required permissions to view the files attached to this post.
Last edited by Keighn on Wed May 22, 2013 11:40 pm, edited 1 time in total.
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

m:learn_spell("og") should be "og2" for mobs
m.pois and m.disease are not in the API and probably wont work that way. I'll can check later if I find anything that might work.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

Thanks. I was thinking about og2.. was initially going to put that in since that's how pet tomes are. One of these days I'll figure out xp. I am wondering though.. if I took out the xp line would the game figure out xp on its own saving me the trouble?

Of other note... I was going to have swamp gas mobs explode in a radial INH effect as I saw wang do this on a few test mobs. Again, I don't know how that works probably something akin to the 360 degree fireball explosion on the inferno dragon.

What's the leprechaun explosion lua and can the damage be reduced and increased?
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

Every mob has some default XP which you can overwrite with m.xp=. If you are unsure about how much XP a mob should give check monsters.txt - It is round about XP = HP - normally more than less.

For a spiral effect you call a simple_send_event as seen below:

Code: Select all

simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("izh"),m.x+1,m.y-1)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x+1,m.y)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x+1,m.y+1)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x,m.y+1)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x-1,m.y+1)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x-1,m.y)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x-1,m.y-1)
    simple_send_event(m.id,EVENT_MAGIC,spells:get_spell_id("inh"),m.x,m.y-1)
Note: you have to set dmg dealt to player extra!

Who wrote the Leprechaun script? Normally you have to code the damage dealt when you call magical effects via LUA, unless you teach the mob the spell.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

Thanks Mort. This is the type of lua input that helps us idiots out that really can't really decipher lua too well. I take it the ("inh") is mandatory in the script there. If I want some other effect it'd be ("izh") for sleep or ("ifh") for fire ("ice") for frost wind or ("og2") for lightning ("vog") for chain lightning or ("xpm") vampyric bit ("xc") death and so on?

Do you know the codes for Queen Aranchina, the Leoric dude and their mobs that happened during birthday of euo? They had some pretty neat script that even cut through protection scrolls. We're hear to learn from the masters. :lesson:
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

Any "wind" magic works with the spiral effect. OG2 as well and VOG would be the same, but notice that only from the mob to the defined traget (e.g. m.x+1, m.y) a lightning bolt will be drawn and no additional chain lightning effects will take place. Besides it is only the graphical effect that will be drawn in game - no damage, no stats effects.

lets say you cast a spiral of INH. Next step is to define the "radius" around the mob in which any damage or stat effects should take place. This you can do using two "for loops" that check every tile in a certain radius around the mob (see below). Next step is to check the resulting x and y coords (in this case xx and yy) for a human player with ptr=get_sent_ptr_xyz(xx,yy,m.map_level)). In the example below ptr will be checked in an "if loop" against its position regarding the mob, if it actually has a value (is nil if xx,yy are empty of any mob or player), etc. In the "if loop" you can define what will happen to the ptr, e.g. set him to sleep. set_health(ptr.id,HN_ASLEEP,5) bypasses any protection scrolls. Other stat effects to name a few are HN_POISONED, HN_BLIND, HN_CONFUSED, HN_HEXED, HN_HALLUCINATING. Well last but not least you have to close the "if and for loops" again.
Wrap it all up in a heart beat function with a random chance to be executed and you have some special attack.

Code: Select all

    sx=m.x-4 -- defines start x-coord for radius effect
    ex=m.x+4 -- defines end x-coord for radius effect
    sy=m.y-4 -- defines start y-coord for radius effect
    ey=m.y+4 -- defines end x-coord for radius effect
   
    for yy=sy,ey do 
      for xx=sx,ex do 
        ptr=get_sent_ptr_xyz(xx,yy,m.map_level)
        if((xx~= m.x or yy~=m.y) and ptr~=nil and ptr:get_align()~=m:get_align() and not ptr:is_dm()) then
          set_health(ptr.id,HN_ASLEEP,5)
        end
      end
    end 
	local_msg(m,"Cassandra sings a lullaby.")
Hope that was somehow understandable and not too many errors slipped in.
User avatar
CIAassassin
Posting from my ass computer.
Posts: 606
Joined: Thu Oct 26, 2006 10:34 am

Re: RFC - Monsters & Uniques

Post by CIAassassin »

LordMortiferus wrote:

Code: Select all

    sx=m.x-4 -- defines start x-coord for radius effect
    ex=m.x+4 -- defines end x-coord for radius effect
    sy=m.y-4 -- defines start y-coord for radius effect
    ey=m.y+4 -- defines end x-coord for radius effect
   
what does the m.x-4 mean? -4 on the x axis from the monster (represented by m?)
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

Yeah m.x and m.y are the current coordinates of the monster that runs this script.
This is the basic way to do area effect stuff like the paralysis of BQ or in this case it puts any player to sleep.
Last edited by LordMortiferus on Thu Jun 13, 2013 6:14 am, edited 1 time in total.
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: RFC - Monsters & Uniques

Post by Keighn »

Kind of curious about chaining spells. (ie... a vog attack but at each monster struck perhaps it explodes in a radial spell like FG or perhaps a FG exploding and each mob struck by an IFH and those hit by that an xc?) Is this possible?
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

Well using the AoE script from above you could use it to get the coordinates of different players save them in an array and start a lightning cascade from mob to player1 to player2 etc. with additional spell effects on the different players. Though you might want to change the order by which the players get attacked.
User avatar
CIAassassin
Posting from my ass computer.
Posts: 606
Joined: Thu Oct 26, 2006 10:34 am

Re: RFC - Monsters & Uniques

Post by CIAassassin »

how do the treasure codes work? I get that they are in hex, but I can't find a comparison anywhere to figure out how to use them properly.

Code: Select all

function md_Corrupted_Fighter_Low(m)
	if m.code == { 0x39a , 0x39d , 0x39e , 0x3a0 , 0x3a1 }
	 m:set_name("Corrupted Fighter")
	 m.code = { 0x39a , 0x39d , 0x39e , 0x3a0 , 0x3a1 }
	 m:set_hp_max(800)
	 m.hp = 800
	 m:set_intel(25)
	 m.mana = 25
	 m:set_magic_resistance(750)
	 m:set_thaco(35)
	 m:set_base_AC(70)
	 m:set_dmg_dice(6)
	 m:set_dmg_sides(7)
	 m:set_align(ALIGN_EVIL)
	 m:set_vision(7)
	 m.speed = 500
	 m.xp_kill(700)
	end
end
corrupted draconian fighter. Trying to attempt to make it a table to look for all 5 possible m.codes and then display the corresponding avatar for that m.code, not sure if I have it right.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
Post Reply