Jump to content
  • 0

call event with arguments on monster death


fusqueta

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  10/26/20
  • Last Seen:  

We have a field to call a function on monster death:

<map name>{,<x>{,<y>{,<xs>{,<ys>}}}}%TAB%monster%TAB%<monster name>{,<monster level>}%TAB%<mob id>,<amount>{,<delay1>{,<delay2>{,<event>{,<mob size>{,<mob ai>}}}}}

 
   
  Event is a script event to be executed when the mob is killed. The event must
  be in the form "NPCName::OnEventName" to execute, and the event name label
  should start with "On". As with all events, if the NPC is an on-touch NPC, the
  player who triggers the script must be within 'trigger' range for the event to
  work.
   
   


 I want to call a event(or a function) with arguments/parameter like callfunc( "function",$parameter);

Is it possible?

Edited by fusqueta
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

7 hours ago, fusqueta said:

We have a field to call a function on monster death:

<map name>{,<x>{,<y>{,<xs>{,<ys>}}}}%TAB%monster%TAB%<monster name>{,<monster level>}%TAB%<mob id>,<amount>{,<delay1>{,<delay2>{,<event>{,<mob size>{,<mob ai>}}}}}

 
   
  Event is a script event to be executed when the mob is killed. The event must
  be in the form "NPCName::OnEventName" to execute, and the event name label
  should start with "On". As with all events, if the NPC is an on-touch NPC, the
  player who triggers the script must be within 'trigger' range for the event to
  work.
   
   


 I want to call a event(or a function) with arguments/parameter like callfunc( "function",$parameter);

Is it possible?

NPC Function Script
function%TAB%script%TAB%<function name>%TAB%{<code>}

This is how you call a NPC function inside NPC script
function TestFunction;

This is how you call a NPC function inside the item_db script section
callfunc( "function",$parameter);

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  10/26/20
  • Last Seen:  

 

38 minutes ago, Poring King said:

NPC Function Script
function%TAB%script%TAB%<function name>%TAB%{<code>}

This is how you call a NPC function inside NPC script
function TestFunction;

This is how you call a NPC function inside the item_db script section
callfunc( "function",$parameter);

But I want to call a function from mobdeath event inside *monster command, not from item_db
ty, anyway

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Just now, fusqueta said:

 

But I want to call a function from mobdeath event inside *monster command, not from item_db
ty, anyway

Already give you answer

 

OnMobDead:
  	function TestFunction;
	Do this after the function
 	end;


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...