MukkiesftKies Posted October 31, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 123 Reputation: 7 Joined: 03/13/12 Last Seen: January 2, 2019 Share Posted October 31, 2013 i requests for guild npc. this npc working like this, guild leader buy a npc guild then only guildmate can use that npc. if guild leader sell that npc, another guild can buy that npc. I want this npc can duplicate. Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 1, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted November 1, 2013 Try this one, bear with my laziness xD i didn't include many dialogues. - script Sample::test -1,{ if ( !getcharid(2) ) end; if ( !$@guild_owner && getcharid(2) ) { if ( getguildmaster( getcharid(2) ) != strcharinfo(0) ) end; mes .npc$; mes "Buy me for " +.prize_of_npc+ " zeny."; next; mes .npc$; if ( Zeny < .prize_of_npc ) mes "You don't have enough zeny"; else Zeny -= .prize_of_npc; $@guild_owner = getcharid(2); announce "[" +getguildname($@guild_owner)+ "] guild bought me for " +.prize_of_npc+ " zeny!",0; close; } if ( getcharid(2) != $@guild_owner ) { mes .npc$; mes "This npc is not dedicated on your guild"; close; } mes .npc$; mes "What you want me to do master?"; next; switch(select("Heal Me:No thanks:" +(getguildmaster($@guild_owner)==strcharinfo(0)?"Sell me":""))) { case 1: percentheal 100,100; break; case 2: break; case 3: mes .npc$; mes "Done!"; Zeny += .prize_of_npc; announce getguildmaster($@guild_owner)+ " sell me. Someone buy me!",0; $@guild_owner = 0; break; default: debugmes "Error on NPC " +.npc$; break; } OnInit: .prize_of_npc = 20; .npc$ = strnpcinfo(1); end; } prontera,150,150,0 duplicate(test) Sample 100 prontera,153,153,0 duplicate(test) Sample 100 Configuration : .prize_of_npc = 20; // price of npc .npc$ = strnpcinfo(1); // npc name When guild bought the npc, You can add more benefit here. On my example i only have heal benefit, i add also the "sell me" choice when talking to the npc : switch(select("Heal Me:No thanks:" +(getguildmaster($@guild_owner)==strcharinfo(0)?"Sell me":""))) 1 Quote Link to comment Share on other sites More sharing options...
MukkiesftKies Posted November 1, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 123 Reputation: 7 Joined: 03/13/12 Last Seen: January 2, 2019 Author Share Posted November 1, 2013 sorry patskie , it about duplicate. i donno how to explain so i give i want to function the same npc, but who differ duplicate, have two guild npc Prontera and payon Guild X buy guild npc at Prontera Guild Y can not buy it but Guild Y can buy guild npc at payon because no one is buying it.btw your script is working Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 1, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted November 1, 2013 Create multiple npc's then with the same function? Having 2 .txt files? Quote Link to comment Share on other sites More sharing options...
MukkiesftKies Posted November 1, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 123 Reputation: 7 Joined: 03/13/12 Last Seen: January 2, 2019 Author Share Posted November 1, 2013 Create multiple npc's then with the same function? Having 2 .txt files? yaa, if can use only one .txt Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 1, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted November 1, 2013 My npc uses a global temporary variable ( $@guild_owner ). If you plan to make multiple npc's with same function but you want it in a way that other guild can buy the other npc's. Just change the guild_owner to anything ( $@guild_owner1 , $@guild_owner2 ) and so on Quote Link to comment Share on other sites More sharing options...
MukkiesftKies Posted November 2, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 123 Reputation: 7 Joined: 03/13/12 Last Seen: January 2, 2019 Author Share Posted November 2, 2013 so you mean like this ? - script Sample::test -1,{ if ( !getcharid(2) ) end; if ( !$@guild_owner1 && getcharid(2) ) { if ( getguildmaster( getcharid(2) ) != strcharinfo(0) ) end; mes .npc$; mes "Buy me for " +.prize_of_npc+ " zeny."; next; mes .npc$; if ( Zeny < .prize_of_npc ) mes "You don't have enough zeny"; else Zeny -= .prize_of_npc; $@guild_owner = getcharid(2); announce "[" +getguildname($@guild_owner1)+ "] guild bought me for " +.prize_of_npc+ " zeny!",0; close; } if ( getcharid(2) != $@guild_owner1 ) { mes .npc$; mes "This npc is not dedicated on your guild"; close; } mes .npc$; mes "What you want me to do master?"; next; switch(select("Heal Me:No thanks:" +(getguildmaster($@guild_owner1)==strcharinfo(0)?"Sell me":""))) { case 1: percentheal 100,100; break; case 2: break; case 3: mes .npc$; mes "Done!"; Zeny += .prize_of_npc; announce getguildmaster($@guild_owner1)+ " sell me. Someone buy me!",0; $@guild_owner = 0; break; default: debugmes "Error on NPC " +.npc$; break; } OnInit: .prize_of_npc = 20; .npc$ = strnpcinfo(1); end; } prontera,150,150,0 duplicate(test) Sample 100 prontera,153,153,0 duplicate(test) Sample 100 or just change at prontera,150,150,0 duplicate(test) Sample 100,{ getguildname("$@guild_owner",1) } prontera,153,153,0 duplicate(test) Sample 100,{ getguildname("$@guild_owner",2) } Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 2, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted November 2, 2013 What i mean is that stick with my script with post#2. What i want you to do is to create another text file on npc folder and change $@guild_owner to $@guild_owner1 since the first script is already using it. You can't stick to $@guild_owner because it is a global variable Quote Link to comment Share on other sites More sharing options...
MukkiesftKies Posted November 2, 2013 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 123 Reputation: 7 Joined: 03/13/12 Last Seen: January 2, 2019 Author Share Posted November 2, 2013 ohh , just create another file .txt okkay2. thanks for help patskie Quote Link to comment Share on other sites More sharing options...
NexusXVI Posted November 3, 2013 Group: Members Topic Count: 61 Topics Per Day: 0.01 Content Count: 227 Reputation: 6 Joined: 01/18/12 Last Seen: May 22, 2022 Share Posted November 3, 2013 (edited) @PaktskieSuggestion : HMm , can u make the npc timed/rented??I mean if GUILD X buy it for like maybe 8 CastleDrop the npc would be thier npc as long as they can pay it.. Maybe for 5 days.That way the guild will do their best to win woe..Failure to Pay the rent will make them lose the npc , and maybe a delay like 1day before they can buy another..Hope this isn't that much trouble. Edited November 3, 2013 by NexusXVI Quote Link to comment Share on other sites More sharing options...
chromus28 Posted November 9, 2013 Group: Members Topic Count: 91 Topics Per Day: 0.02 Content Count: 263 Reputation: 1 Joined: 04/25/13 Last Seen: December 20, 2014 Share Posted November 9, 2013 Try this one, bear with my laziness xD i didn't include many dialogues. - script Sample::test -1,{ if ( !getcharid(2) ) end; if ( !$@guild_owner && getcharid(2) ) { if ( getguildmaster( getcharid(2) ) != strcharinfo(0) ) end; mes .npc$; mes "Buy me for " +.prize_of_npc+ " zeny."; next; mes .npc$; if ( Zeny < .prize_of_npc ) mes "You don't have enough zeny"; else Zeny -= .prize_of_npc; $@guild_owner = getcharid(2); announce "[" +getguildname($@guild_owner)+ "] guild bought me for " +.prize_of_npc+ " zeny!",0; close; } if ( getcharid(2) != $@guild_owner ) { mes .npc$; mes "This npc is not dedicated on your guild"; close; } mes .npc$; mes "What you want me to do master?"; next; switch(select("Heal Me:No thanks:" +(getguildmaster($@guild_owner)==strcharinfo(0)?"Sell me":""))) { case 1: percentheal 100,100; break; case 2: break; case 3: mes .npc$; mes "Done!"; Zeny += .prize_of_npc; announce getguildmaster($@guild_owner)+ " sell me. Someone buy me!",0; $@guild_owner = 0; break; default: debugmes "Error on NPC " +.npc$; break; } OnInit: .prize_of_npc = 20; .npc$ = strnpcinfo(1); end; } prontera,150,150,0 duplicate(test) Sample 100 prontera,153,153,0 duplicate(test) Sample 100 Configuration : .prize_of_npc = 20; // price of npc .npc$ = strnpcinfo(1); // npc name When guild bought the npc, You can add more benefit here. On my example i only have heal benefit, i add also the "sell me" choice when talking to the npc : switch(select("Heal Me:No thanks:" +(getguildmaster($@guild_owner)==strcharinfo(0)?"Sell me":""))) sir im getting error on this part >> Zeny -= .prize_of_npc; Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 9, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 11 hours ago Share Posted November 9, 2013 Maybe you are using eAthena? Quote Link to comment Share on other sites More sharing options...
chromus28 Posted November 11, 2013 Group: Members Topic Count: 91 Topics Per Day: 0.02 Content Count: 263 Reputation: 1 Joined: 04/25/13 Last Seen: December 20, 2014 Share Posted November 11, 2013 Maybe you are using eAthena? aw yeah,,T-T ok thanks Quote Link to comment Share on other sites More sharing options...
Question
MukkiesftKies
i requests for guild npc.
this npc working like this,
guild leader buy a npc guild then only guildmate can use that npc.
if guild leader sell that npc, another guild can buy that npc.
I want this npc can duplicate.
Link to comment
Share on other sites
12 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.