Jump to content
  • 0

Item in a specific map


Question

9 answers to this question

Recommended Posts

Posted (edited)

This would work singularly as well:

 

 

-    script    mobitemadder    -1,{

    OnNPCKillEvent:
        if(strcharinfo(3) == $mobaddmap$ && killedrid == $mobaddID)
            getitem $mobadditem,$mobaddamt;
            end;
    
    // Configuration
    //OnWhisperGlobal:
    OnInit:
        $mobaddID = 1002;                    // Define mob ID number
        $mobaddmap$ = "prt_fild08";        // Define map name
        $mobadditem = 7227;                // Define item ID
        $mobaddamt = 1;                    // Define amount
        dispbottom "Configuration loaded.";    // Vanity confirmation
        end;
    
}

 

It can be customized easily by using an array instead, if you want. Just make sure to reconfigure the settings.

Edited by Via
Posted
This would work singularly as well:

 

Not really because this way, the player get the items directly on his inventory

 

btw replace all your permanent variable by npc variable, no need the permanent here

Posted
    OnInit:
        //...
        dispbottom "Configuration loaded.";    // Vanity confirmation

'dispbottom' requires an RID, perhaps you meant 'logmes'?

Posted (edited)

Not really because this way, the player get the items directly on his inventory

 

btw replace all your permanent variable by npc variable, no need the permanent here

 

You could make it drop on the floor with makeitem, I believe.

 

-    script    mobitemadder    -1, {

    OnNPCKillEvent:
        if(strcharinfo(3) == .@mobaddmap$ && killedrid == .@mobaddID)
            //getitem .@mobadditem = .@mobaddamt;
            getmapxy(.@M$,.@X,.@Y,0);
            makeitem .@mobadditem,.@mobaddamt,.@M$,.@X,.@Y;
            end;
    
    // Configuration
    //OnWhisperGlobal:
    OnInit:
        .@mobaddID = 1002;                    // Define mob ID number
        .@mobaddmap$ = "prt_fild08";        // Define map name
        .@mobadditem = 7227;                // Define item ID
        .@mobaddamt = 1;                    // Define amount
        //dispbottom "Configuration loaded.";    // Vanity confirmation
        end;
    
}

 

 

'dispbottom' requires an RID, perhaps you meant 'logmes'?

 

I added that vanity display message when using the OnWhisperGlobal label to invoke the configuration (as opposed to using @reloadscript?)

Edited by Via
Posted

You could make it drop on the floor with makeitem, I believe.

Yes but you forgot the Brackets

 

.@variables will be delete at the end of the script

Use .variables

 

"."      - A NPC variable.

           They exist in the NPC and disappear when the server restarts or the

           NPC is reloaded. Can be accessed from inside the NPC or by calling

           'getvariableofnpc'. Function objects can also have .variables which

           are accessible from inside the function, however 'getvariableofnpc'

           does NOT work on function objects.

Posted (edited)

Woops. The original code was one line, so I sorta forgot.

 

 

-    script    mobitemadder    -1, {

    OnNPCKillEvent:
        if(strcharinfo(3) == .mobaddmap$ && killedrid == .mobaddID) {
            //getitem .mobadditem = .mobaddamt;
            getmapxy(.@M$,.@X,.@Y,0);
            makeitem .mobadditem,.mobaddamt,.@M$,.@X,.@Y;
        }
        end;
    
    // Configuration
    //OnWhisperGlobal:
    OnInit:
        .mobaddID = 1002;                    // Define mob ID number
        .mobaddmap$ = "prt_fild08";        // Define map name
        .mobadditem = 7227;                // Define item ID
        .mobaddamt = 1;                    // Define amount
        //dispbottom "Configuration loaded.";    // Vanity confirmation
        end;
    
}
Edited by Via
Posted

Woops. The original code was one line, so I sorta forgot.

 

 

-    script    mobitemadder    -1, {

    OnNPCKillEvent:
        if(strcharinfo(3) == .mobaddmap$ && killedrid == .mobaddID) {
            //getitem .mobadditem = .mobaddamt;
            getmapxy(.@M$,.@X,.@Y,0);
            makeitem .mobadditem,.mobaddamt,.@M$,.@X,.@Y;
        }
        end;
    
    // Configuration
    //OnWhisperGlobal:
    OnInit:
        .mobaddID = 1002;                    // Define mob ID number
        .mobaddmap$ = "prt_fild08";        // Define map name
        .mobadditem = 7227;                // Define item ID
        .mobaddamt = 1;                    // Define amount
        //dispbottom "Configuration loaded.";    // Vanity confirmation
        end;
    
}

Is this a npc only?

Do i need to patch first the one that Euphy first before i start running that script?

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