Jump to content
  • 0

Specific Npc Script [HELP :D]


Oraios

Question


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

Dear community,

I want a Npc on which the castle owner (guild leader) of prtg_cas01 can click on an Npc on which he can obtain specific item with a random chance :)

 

Can anyone help me? :D

Link to comment
Share on other sites

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

Try this one player can only talk to npc if WOE is not activated : 

prontera,150,150,0    script    Sample    100,{
    query_sql "SELECT `guild_id` FROM `guild_castle` WHERE `castle_id` = 15",@gid;
    set .@chance, 30; // 30% chance
    setarray .@items[0],4001,4002,4003; // <item id>
    set .@size, getarraysize(.@items);
    set .@random, rand(.@size);
    
    if ( !getcharid(2) || !@gid || agitcheck() || agitcheck2() ) end;
    if ( (@gid == getcharid(2)) && (getguildmaster(getcharid(2)) == strcharinfo(0)) ) {
        if ( rand(100) < .@chance ) 
            getitem .@items[.@random], 1;
    }
    end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

the script doesn´t work :/

Link to comment
Share on other sites


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

the script doesn´t work :/

Maybe you can show error if any? 

 

1. 

prontera,150,150,0<TAB>script<TAB>Sample<TAB>100,{

2. The guild master can get the item in a chance of 30%

 

Anyway this works fine on my test server.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

When I click on the npc nothing happen...

Link to comment
Share on other sites


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

Either no guild or no castle owner of prtg_cas01 or woe is starting. When this is true then the script will end.

if ( !getcharid(2) || !@gid || agitcheck() || agitcheck2() ) end;
 
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   1
  • Joined:  11/06/12
  • Last Seen:  

hmm i don t know but it doesnt work :(

Link to comment
Share on other sites


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

if( getcharid(0) == getguildmasterid( getcastledata( "prtg_cas01",1 ) ) ){
	// get item ....
}
end;

you dont have to run sql command to retrieve the guild id ...

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