• 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!

Register creatureevent to all monsters

andu

Sold 649 scripts, 25 maps and 9 events!
Joined
Aug 7, 2009
Messages
969
Solutions
17
Reaction score
353
GitHub
olrios
Twitch
olrios
What is the easiest way to register a creatureevent to all players and monsters on the server?

For players in know, in login.lua. How to register it for monsters? In the fastest way.
 
Solution
There is 2 Ways.Both Are Source Edits
For Monsters
1-http://otland.net/threads/creaturee...ster-and-players-in-creatureevent-xml.134003/
2-in monster.cpp
Edit This Line
Code:
for(StringVec::iterator it = mType->scriptList.begin(); it != mType->scriptList.end(); ++it)
   {
     if(!registerCreatureEvent(*it))
       std::clog << "[Warning - Monster::Monster] Unknown event name - " << *it << std::endl;
   }

To
Code:
for(StringVec::iterator it = mType->scriptList.begin(); it != mType->scriptList.end(); ++it)
   {
      registerCreatureEvent("YoureventName");
     if(!registerCreatureEvent(*it))
       std::clog << "[Warning - Monster::Monster] Unknown event name - " << *it << std::endl;
   }

I...
I have to record damage done to monsters, so only onStatsChange will be good here. But how to register this event to all mobs in one easy way?
 
There is 2 Ways.Both Are Source Edits
For Monsters
1-http://otland.net/threads/creaturee...ster-and-players-in-creatureevent-xml.134003/
2-in monster.cpp
Edit This Line
Code:
for(StringVec::iterator it = mType->scriptList.begin(); it != mType->scriptList.end(); ++it)
   {
     if(!registerCreatureEvent(*it))
       std::clog << "[Warning - Monster::Monster] Unknown event name - " << *it << std::endl;
   }

To
Code:
for(StringVec::iterator it = mType->scriptList.begin(); it != mType->scriptList.end(); ++it)
   {
      registerCreatureEvent("YoureventName");
     if(!registerCreatureEvent(*it))
       std::clog << "[Warning - Monster::Monster] Unknown event name - " << *it << std::endl;
   }

I Haven't Tested Anyone of them but they might work.Just Make sure the event exist so it don't crash
For Players
login.lua :)
 
Solution
Back
Top