Jump to content
  • 0

Scripting: On Kill Mob -> Do something


Question

Posted

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 =/

3 answers to this question

Recommended Posts

Posted

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.

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

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