Jump to content
  • 0

call event with arguments on monster death


Question

Posted (edited)

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

3 answers to this question

Recommended Posts

  • 0
Posted
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);

  • 0
Posted

 

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

  • 0
Posted
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;


 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...