• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Lua Particular monster on spawn in map

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
500
Solutions
4
Reaction score
101
Location
player:getTown()
It's possible to fire lua script on spawn one monster type in map (using only monster xml file and lua)?
 

ScorpionOT

uber n00b
Joined
Mar 28, 2015
Messages
410
Solutions
6
Reaction score
126
I believe it was, back in the day. You'd need to declare either an onThink creatureevent for the creature.xml, or an onSpawn, if there is such a thing. Please do some research, or look into your source files, and if you are able to communicate further, we might be able to help.
 
OP
OP
hellboy

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
500
Solutions
4
Reaction score
101
Location
player:getTown()
I believe it was, back in the day. You'd need to declare either an onThink creatureevent for the creature.xml, or an onSpawn, if there is such a thing. Please do some research, or look into your source files, and if you are able to communicate further, we might be able to help.

I fount something like that in source: forgottenserver/monsters.cpp at master · otland/forgottenserver · GitHub
Could you provide any example? I can't find anything in default data pack in data/monsters that look like

Code:
<script>
[...]

Code:
grep -r 'script' monster/ | grep -iv 'namedescription' | wc -l
Return 0
 

Infernum

Senator
Joined
Feb 14, 2015
Messages
5,638
Solutions
559
Reaction score
3,906
check my signature for a 1.2 implementation of onSpawn
if you're not using 1.2 just use the search bar and look for onSpawn for your tfs version
 
OP
OP
hellboy

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
500
Solutions
4
Reaction score
101
Location
player:getTown()
check my signature for a 1.2 implementation of onSpawn
if you're not using 1.2 just use the search bar and look for onSpawn for your tfs version
Thanks. I'll search few days in forum for another answer. If I can't find anything else, I'll mark your answer as "Best answer" and set Thread as resolved.
 
Top