Jump to content
  • 0

Guild NPC


MukkiesftKies

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

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


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

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":"")))
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

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

Create multiple npc's then with the same function? Having 2 .txt files?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

Create multiple npc's then with the same function? Having 2 .txt files?

 

yaa, if can use only one .txt

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:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

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) }

 

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:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  123
  • Reputation:   7
  • Joined:  03/13/12
  • Last Seen:  

ohh , just create another file .txt

 

okkay2. thanks for help patskie :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

@Paktskie

Suggestion : 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 by NexusXVI
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  263
  • Reputation:   1
  • Joined:  04/25/13
  • Last Seen:  

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;

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:  

Maybe you are using eAthena?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  263
  • Reputation:   1
  • Joined:  04/25/13
  • Last Seen:  

Maybe you are using eAthena?

aw yeah,,T-T ok thanks

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