Oraios Posted August 15, 2013 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
Patskie Posted August 15, 2013 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
Patskie Posted August 15, 2013 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
Oraios Posted August 15, 2013 Author Posted August 15, 2013 When I click on the npc nothing happen... Quote
Patskie Posted August 15, 2013 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
Oraios Posted August 15, 2013 Author Posted August 15, 2013 hmm i don t know but it doesnt work Quote
Emistry Posted August 15, 2013 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
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?
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.