Oraios Posted August 15, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 60 Reputation: 1 Joined: 11/06/12 Last Seen: December 16, 2016 Share Posted August 15, 2013 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? Quote Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 12 hours ago Share Posted August 15, 2013 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; } Quote Link to comment Share on other sites More sharing options...
Oraios Posted August 15, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 60 Reputation: 1 Joined: 11/06/12 Last Seen: December 16, 2016 Author Share Posted August 15, 2013 the script doesn´t work :/ Quote Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 12 hours ago Share Posted August 15, 2013 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. Quote Link to comment Share on other sites More sharing options...
Oraios Posted August 15, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 60 Reputation: 1 Joined: 11/06/12 Last Seen: December 16, 2016 Author Share Posted August 15, 2013 When I click on the npc nothing happen... Quote Link to comment Share on other sites More sharing options...
Patskie Posted August 15, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 12 hours ago Share Posted August 15, 2013 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; Quote Link to comment Share on other sites More sharing options...
Oraios Posted August 15, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 60 Reputation: 1 Joined: 11/06/12 Last Seen: December 16, 2016 Author Share Posted August 15, 2013 hmm i don t know but it doesnt work Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 15, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: April 20 Share Posted August 15, 2013 if( getcharid(0) == getguildmasterid( getcastledata( "prtg_cas01",1 ) ) ){ // get item .... } end; you dont have to run sql command to retrieve the guild id ... Quote Link to comment Share on other sites More sharing options...
Question
Oraios
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?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.