RFC - Monsters & Uniques

Moderator: EUO Moderators

Chedich
on lolpatrol
Posts: 254
Joined: Wed Jan 14, 2004 12:51 am

Re: RFC - Monsters & Uniques

Post by Chedich »

You should check out http://euotopia.com/manual/index.php/Ru ... g_with_LUA. There's some info on how the treasure code works in there as well.
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 »

I will keep that bookmarked, Ill worry about that at a later time. For now I have to figure out why my elite guards codes are running together, and finish coding some of the other bosses.

Code: Select all

--start high mob special attacks
function md_Corrupted_Fighter_High_Actions(m)
	if math.random(1,50) == 1 and m.target_id >= 0 then --Matriarchs Battle Cry stun/blind
	 ptr = get_sent_ptr(m.target_id)
	 local_msg(m, "The Fighter channels the Matriarchs Battle Cry")
	 spell_turn("AXC",m)
	 sx=m.x-2
	 ex=m.x+2
	 sy=m.y-2
	 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()~=me:get_align() and not ptr:is_dm())
		 then
		 ptr:set_health(HN_BLIND,5)
		 ptr:set_health(HN_PARALIZED,5)
		end
	end
	if math.random(1,50) == 5 or 10 or 15 and m.target_id >= 0 then --focused strike, channels one massive attack.
	 local_msg(m, "The Fighter channels all of his strength into the blade!")		
	 ptr = get_sent_ptr(m.target_id)
     x = ptr.x - m.x 
	 y = ptr.y - m.y
	 dr = math.deg(math.atan2(y,x))
	 agls = 45
	 for d = 1, 5 do
	 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()~=me:get_align() and not ptr:is_dm())
		 then
		 hurt(ptr.id, math.random(230,460), "Focused Strike")
		end
	end
end

function md_Corrupted_Rogue_High_Actions(m)
	if math.random(1,50) == 1 and m.target_id >= 0 then -- spray and pray
	 ptr = get_sent_ptr(m.target_id)
	 sx=m.x-5
	 ex=m.x+5
	 sy=m.y-5
	 ey=m.y+5
	 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()~=me:get_align() and not ptr:is_dm())
		 then
		 hurt(ptr.id, math.random(100,200), "spray and pray")
		 local_msg(m, "The Ranger unleashes a quiver of arrows into the room")
		end
	end
	if math.random(1,50) == 5 or 10 or 15 and m.target_id >= 0 then --whirlwind, causes bleeding and close range dmg
	 ptr = get_sent_ptr(m.target_id)
	 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)
		if(xx~=m.x or yy~=m.y and ptr~=nil and ptr:get_align()~=me:get_align() and not ptr:is_dm())
		 then
		 hurt(ptr.id, math.random(75,150), "whirlwind")
		 ptr:set_health(HN_BLEEDING,25)
		 local_msg(m, "The Ranger spins with swords drawn, slashing all nearby")
		end
	end
end
--end high mob special attacks
ok, I cant figure it out. It is bleeding together, ie not split as individual functions like the non-special-move functions are. Ive got enough end, and I removed a few open (). Anyone of you see anything that needs to be addressed?
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 »

Had a quick look at the script and found a couple of things:

--start high mob special attacks
function md_Corrupted_Fighter_High_Actions(m)
if math.random(1,50) == 1 and m.target_id >= 0 then --Matriarchs Battle Cry stun/blind
ptr = get_sent_ptr(m.target_id) -- you do not need this line here since you redefine ptr in the for loops
local_msg(m, "The Fighter channels the Matriarchs Battle Cry")
spell_turn("AXC",m) -- axc should be lowercase and you would probably be better off with simple_event or simple_send_event I guess
sx=m.x-2
ex=m.x+2
sy=m.y-2
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()~=me:get_align() and not ptr:is_dm()) -- m:get_align() not me:get_align()
then
ptr:set_health(HN_BLIND,5)
ptr:set_health(HN_PARALIZED,5)
end
end
if math.random(1,50) == 5 or 10 or 15 and m.target_id >= 0 then --focused strike, channels one massive attack. -- "or 10 or 15" are invalid arguments just make math.random(1,30) == 1
local_msg(m, "The Fighter channels all of his strength into the blade!")
ptr = get_sent_ptr(m.target_id)
x = ptr.x - m.x
y = ptr.y - m.y
dr = math.deg(math.atan2(y,x))
agls = 45
for d = 1, 5 do
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()~=me:get_align() and not ptr:is_dm()) -- me: again
then
hurt(ptr.id, math.random(230,460), "Focused Strike")
end
end
end

function md_Corrupted_Rogue_High_Actions(m)
if math.random(1,50) == 1 and m.target_id >= 0 then -- spray and pray
ptr = get_sent_ptr(m.target_id) -- again you do not need this here
sx=m.x-5
ex=m.x+5
sy=m.y-5
ey=m.y+5
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()~=me:get_align() and not ptr:is_dm()) -- m:get_align()
then
hurt(ptr.id, math.random(100,200), "spray and pray")
local_msg(m, "The Ranger unleashes a quiver of arrows into the room") -- even with the latest client updates that stack msg's I would move local_msg out of loops
end
end -- the two for loops are closed but not the if cause
if math.random(1,50) == 5 or 10 or 15 and m.target_id >= 0 then --whirlwind, causes bleeding and close range dmg
ptr = get_sent_ptr(m.target_id) -- see above
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)
if(xx~=m.x or yy~=m.y and ptr~=nil and ptr:get_align()~=me:get_align() and not ptr:is_dm()) -- see above
then
hurt(ptr.id, math.random(75,150), "whirlwind")
ptr:set_health(HN_BLEEDING,25)
local_msg(m, "The Ranger spins with swords drawn, slashing all nearby") -- see above nip picking though
end
end
end
--end high mob special attacks[/code]

You should check if all functions, statements and loops are closed with "end". For spray and pray you could try spell_spray(string, Sentient*, Sentient*, bool, int, int, string="");
Edit:
send_event(m.map_level,m.id,m.x,m.y,EVENT_MAGIC, spells:get_spell_id("roar") , m.x, m.y) for battle roar
Last edited by LordMortiferus on Thu Jun 27, 2013 3:28 am, edited 1 time in total.
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 »

A lot of the code I used I was going off what was posted through the forums and such. A lot of the syntax I simply don't know, or understand at this point. Things like the double defining, Local Message in the loops, was from my reading of some of Rusty's mob code and not being entirely sure on how to make it fly.

this: spell_spray(string, Sentient*, Sentient*, bool, int, int, string=""); I don't even know how to get some of the spells, and everything in the () is Greek to me.

or what a simple_event is, let alone how to code it.
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 »

Like I said the local-msg in the for loops is nip picking and should be solved by msg stacking of the client.

Instead of spell_turn you can use the following code to make the mob roar - at least I guess that was your initial idea anyway.
send_event(m.map_level,m.id,m.x,m.y,EVENT_MAGIC, spells:get_spell_id("roar") , m.x, m.y)

Forget what I wrote about spray and pray - got the wrong piece of code.

Edit:
But this could work to draw arrows shooting from the mob to its targets:
send_event(m.map_level,-1,m.x,m.y,EVENT_MISSLE,MISSLE_AMMO,xx,yy)
Last edited by LordMortiferus on Thu Jun 27, 2013 3:35 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

Basics 1

Post by Keighn »

How about some basic stuff:
1. Slime Dividing (applicable to other mobs)
2. Monster Regeneration
3. Monster Calling for Aid x#times (not to be confused with summoning) {ie. pirate blaine)
4. Summoning Specific Mob via spell (like bat or another shadow warrior)
5. Allowing Flying
6. Allowing Lava Walk
7. Allowing Mountain Walk
8. Allowing walking through walls
9. Improved Invisible like the Shadow Imps in Deja Vu
10. vampyric ability ie... like a vampy longsword but for a mob (so it can get hp when it strikes) (again not spell based xc or xmp)
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 »

send_event(m.map_level,-1,m.x,m.y,EVENT_MISSLE,MISSLE_AMMO,xx,yy)

I get what it SUPPOSED to do, but I dont get how it does it. I understand it's calling the arrow and such... basically I don't know when I would use that, and how to tailor it.
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 »

if m.code == { 0x39a , 0x39d , 0x39e , 0x3a0 , 0x3a1 } then
m:set_name("Corrupted Fighter")
m.code = { 0x39a , 0x39d , 0x39e , 0x3a0 , 0x3a1 } -- I do not really know what you want to achieve with this

This wont work. You have to make an array containing the codes. e.g.:

mobarray = { 0x39a , 0x39d , 0x39e , 0x3a0 , 0x3a1 }
for k, v in pairs(mobarray) do
if v == m.code then
m:set_name("Corrupted Fighter")
m.code = get_random_element(mobarray) -- at least I guess that's what you want (get_random_element is a function written by max)
end
end
User avatar
LordMortiferus
MACRO > me
Posts: 872
Joined: Tue Dec 01, 2009 10:23 pm

Re: RFC - Monsters & Uniques

Post by LordMortiferus »

Riki I guess your spray and pray function for the rouge is supposed to be an enhance ranged attack shooting arrows at all players around the mob. Add the sent_event in the if-statement so not only will everyone get hurt but you also see the reason for the hit, in this case an arrow.

Should look like this and I hope it is correct ^^

sx=m.x-5
ex=m.x+5
sy=m.y-5
ey=m.y+5
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
send_event(m.map_level,-1,m.x,m.y,EVENT_MISSLE,MISSLE_AMMO,xx,yy)
hurt(ptr.id, math.random(100,200), "spray and pray")
end
end
local_msg(m, "The Ranger unleashes a quiver of arrows into the room")
end
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 »

Im cleaning everything up right now actually. Talking with Ched on Skype. I dunno why I put the m.code into the script now that it has been corrected.

what does the -1 signify?
You do not have the required permissions to view the files attached to this post.
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 »

The spot where the -1 is is supposed to be the id of the "caster". On the fly I have no idea why it is -1 and not m.id - I lifted it from some script as well.
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 »

honestly it would be nice to have a semi-compiled list of m.[call] and m:[call] other than the one on the wikipedia by rusty, or get more codes.

Ill keep that in mind as I figure out LUA more.

Other than that, how did the codes look? I have a feeling the local_msg() is out of place still. Changing the second if block to a else if threw me off a tad.
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: Basics 1

Post by LordMortiferus »

Keighn wrote:How about some basic stuff:
1. Slime Dividing (applicable to other mobs)
2. Monster Regeneration
3. Monster Calling for Aid x#times (not to be confused with summoning) {ie. pirate blaine)
4. Summoning Specific Mob via spell (like bat or another shadow warrior)
5. Allowing Flying
6. Allowing Lava Walk
7. Allowing Mountain Walk
8. Allowing walking through walls
9. Improved Invisible like the Shadow Imps in Deja Vu
10. vampyric ability ie... like a vampy longsword but for a mob (so it can get hp when it strikes) (again not spell based xc or xmp)
1. I think rusty posted that somewhere (#evil slime #death_func)
2-4. Can be handled with a heartbeat_func
5. m.flying=true
6. m.lava_walk=true
7. m.mountain_walk=true
8.
9. heartbeat_func

Code: Select all

if m.target_id >= 0 and m:get_health(HN_INVISIBLE) == -1 and int_rand(3) == 1 then
		m:set_health(HN_INVISIBLE,0) -- become visible if targeting an enemy
		update_everyones_fov(m)
		
	elseif  m.target_id < 0 and m:get_health(HN_INVISIBLE) == 0 then
		m:set_health(HN_INVISIBLE,-1)
		update_everyones_fov(m)
end
10. m.vampyric=true
User avatar
Keighn
Stop posting already --;
Posts: 5509
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

UNDEAD PART 1

Post by Keighn »

Dracolich (basic)
Hit points: 450
dmg: 6d8
xp: ??
Int: 600
MR: 700
AS: 35
AC: 40
Sight: 5
Morale: 20
Spells: Cone of Ice, Summon Greater Undead, Reveal, death missile, soul transfer
Specials: touch = aspect of yeti
Undead: Yes
Fly: yes

Death Dragon: (Basic)
Hit points: 650
dmg: 8d8
xp: ??
Int: 800
MR: 1,000
AS: 55
AC: 60
Sight: 5
Morale: 20
Spells: Cone of Acid, Summon Undead Warriors, Reveal, xen corp, soul transfer, aep
Undead: Yes
Fly: yes
Poisonous: Yes
Disease: Yes
Vampyric: Yes

Eh.. not feeling uber inspired atm... even though ideas are floating in my head.
Post Reply