• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Got 1 question

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
I want to make an script that make an boss that unable to attack untill u either killed a certain mob or pulled x levers. i wonder is that possible? and if so anyone care to make it or just the basics?
 
For starters, you would need to make it so that after you killed the certain mob or pulled the levers you would get a storageValue set... then you could use a script similar to this creaturescript:

LUA:
local config = {
	storage_value = 55555,
	boss_name = 'Orshabaal'
}

function onStatsChange(cid, attacker, type, combat, value)
	
	if(attacker == config.boss_name) then
		if(getPlayerStorageValue(cid, config.storage_value) == -1) then
			return false
		end
	end

	return true
end

This will mean that the boss will still attack but unless you set your storage value to something other than the default, nothing will happen. He won`t damage you, etc...

I know it`s not exactly what you`re looking for but maybe it`ll help you out :P
 
The problem of this script is that you can't make an onTarget or onAttack script return false, or atleast, it won't stop attacking you.
I think you need to source edit to be able to do this, or just make a room which you can enter after you cleared all monsters in a room.
 
Make two different monsters

One is immortal (<flag attackable="0"/>), and the other not immortal (<flag attackable="1"/>).
Of course, it's possible to have the same name.

So, the script would determine if you have killed the mob, when it does, it would remove the immortal one and summon the one that is not immortal.

I don't know if that's what you want, sorry if it's not.
 
I already thought of that, just wanna see if there is any other solutions for it. kinda looks gay if 1 boss dissapear and then come back again :P

Edit: forgot to say thanks for trying tho :)
 
Last edited:
I don't think it would look gay at all. You wouldn't even realize that the immortal one disappeared nor the mortal one appearing. If you have them removed and appeared in the same function, bingo, you won't even tell which is which.
 
btw it didnt work :P Unless you know how to Summon the correct one if both got the same name? :P


Edit: becuse i tried to make it with a dragon just for testing and well....
 
Have two different monster file names:

monster1.xml
monster2.xml

Then within the files, have the same names, so if your monster name is Demon, then put Demon in both files.

Then in monsters.xml:

<monster name="monster1" file="monster1.xml"/>
<monster name="monster2" file="monster2.xml"/>

So, to use the script, just do something like (dunno the exact function for removing monsters):

doRemoveCreature("monster1", pos)
doSummonCreature("monster2", pos)

Something like that.

Whatever name you put in the monsters.xml file, that is global, you have to use that name in scripts, in-game (/m monster1).
 
Back
Top