Jump to content
  • 0

Scripting: On Kill Mob -> Do something


Exportforce

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

Hello,

 

long time not active and going to redo my old scripts.

So I got a few small questions...

 

1. How do I do a script which does X on every single mob kill?

Like saving a kill of a mob into a database incl. account id, char id ?

(Yes I do know that I will need an extra table for that info)

 

2. Is it still possible to use PHP for Scripting ?

If yes, how did that work ?

 

Sorry but being away for 3 years lets you forget a lot =/

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

1. Like this : 

/*
    CREATE TABLE IF NOT EXISTS `sample` (
        `account_id` INT(11) unsigned NOT NULL DEFAULT '0',
        `char_id` INT(11) unsigned NOT NULL DEFAULT '0',
        `mob_id` INT(11) unsigned NOT NULL DEFAULT '0'
    ) ENGINE=MyISAM;
*/

-    script    Sample    -1,{
    OnNPCKillEvent:
        if ( !query_sql("SELECT `mob_id` FROM `sample` WHERE `mob_id` = '" +killedrid+ "'") )
            query_sql "INSERT INTO `sample` VALUES ( '" +getcharid(3)+ "', '" +getcharid(0)+ "', '" +killedrid+ "' )";
            
        end;
}

2. You cannot use PHP on rAthena scripts.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

1. How do I do a script which does X on every single mob kill?

Like saving a kill of a mob into a database incl. account id, char id ?

(Yes I do know that I will need an extra table for that info)

seperate kill count for each monster ?? or just total killcount for all monsters ??

 

2. Is it still possible to use PHP for Scripting ?

If yes, how did that work ?

no....*athena is not a PHP based...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

Hello,

 

thanks for the fast answers!

 

Ah yes... Seem to remember. Thanks Patskie!

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...