Jump to content
  • 0

Change a noob npc into a pro npc


cmsm94

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

I want a npc like this turn from a normal boring npc when you click it will open a shop. The item require vote point.

Basically a npc like shop npc with vote point which allow players to buy the item. Not a quest type.
p1.jpg

 

prontera,154,181,3    script    VoteForPoint    120,{
 
    setarray @vote_item[0],            512, 513; // Item ID
    setarray @vote_item_count[0],    1  , 1; // Item Count wich will be given
    setarray @vote_cost[0],            1  , 2; // Cost in Vote Points
    set @min_vote, 0; // minimum count on Vote Points to see the Item List
    set @npcname$,"[^ff0000Npcname^000000]";
 
    query_sql ("SELECT `point` FROM `vote_point` WHERE `account_id` = '"+getcharid(3)+"'", @vote);
 
    mes @npcname$;
    mes "You have ^ff0000"+@vote+"^000000 Vote Points!";
    if( @vote < @min_vote ) {
        mes "^ff0000You will need "+@min_vote+" or more Vote Points to trade them with me!^000000";
        close;
    }
    if (select("Trade my Points!","Cancel~") == 2) 
        close;
 
    next;
    mes "[^ff0000List^000000]";
    mes "^0000ffItem^000000 = ^00aa00Cost^000000";
    for( set .@i, 0; .@i < getarraysize(@vote_item); set .@i, .@i + 1 ) {
        mes "^0000ff"+@vote_item_count[.@i]+"x "+getitemname(@vote_item[.@i])+"^000000 = ^00aa00"+@vote_cost[.@i]+"^000000";
        if( .@i < 1 )
            set .@menu$, getitemname(@vote_item[.@i]);
        else
            set .@menu$, .@menu$+":"+getitemname(@vote_item[.@i]);
    }
 
    next;
    select(.@menu$);
    set @choice, @menu - 1;
 
    mes @npcname$;
    if( @vote_cost[@choice] > @vote ) {
        mes "^ff0000You dont have enought Vote Point for "+@vote_item_count[@choice]+"x '"+getitemname(@vote_item[@choice])+"' :/^000000";
        close;
    }
    mes "Are u realy sure to trade "+@vote_item_count[@choice]+"x '^ff0000"+getitemname(@vote_item[@choice])+"^000000' for ^00aa00"+@vote_cost[@choice]+"^000000 Vote Points?";
    if(select("No! Cancel!:Yes, Trade me!") == 1 ) {
        mes "^ff0000Trade was canceled~^000000";
        close;
    }
 
    set .@new, @vote - @vote_cost[@choice];
    if( .@new < 0 ) // safty first..
        set .@new, 0;
    query_sql("UPDATE `vote_point` SET `point` = '"+.@new+"' WHERE `account_id` = '"+getcharid(3)+"'");
    getitem @vote_item[@choice], @vote_item_count[@choice];
    mes "^00aa00Trade was Successfull  Hope to see u again =)!^000000";
    close;
}


Bump



Bump!!!

Edited by cmsm94
Use code tag
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   8
  • Joined:  03/24/12
  • Last Seen:  

I apologize, i did not understand what the problem actually is, i understand that the npc is boring, but what is it that you want?

 

You need an npc that Allows a player to buy items for vote points which are stored in a database? but you don't want it to be the classic Shop Window-like NPC like in most of the lame servers out there?.

 

if so, let me know, i think i might be able to help you. /ok

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Actually I think his issue is just the exact opposite. His script is done through the interface of a normal NPC using menu's where you just choose it and read the requirements. I believe he wants his script to be turned into a Shop NPC.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  170
  • Reputation:   5
  • Joined:  08/11/13
  • Last Seen:  

Actually I think his issue is just the exact opposite. His script is done through the interface of a normal NPC using menu's where you just choose it and read the requirements. I believe he wants his script to be turned into a Shop NPC.

Exactly thanks for understanding btw haha its not lame la just i dont like the npc like this :(

Actually I think his issue is just the exact opposite. His script is done through the interface of a normal NPC using menu's where you just choose it and read the requirements. I believe he wants his script to be turned into a Shop NPC.

 

I apologize, i did not understand what the problem actually is, i understand that the npc is boring, but what is it that you want?

 

You need an npc that Allows a player to buy items for vote points which are stored in a database? but you don't want it to be the classic Shop Window-like NPC like in most of the lame servers out there?.

 

if so, let me know, i think i might be able to help you. /ok

tthere

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   8
  • Joined:  03/24/12
  • Last Seen:  

Oh, too bad, but there must be a script like that you can re-use around in the forums, i've seen that stuff in every server i've ever set foot in, im sorry i cannot help you, but good luck! /gawi

Link to comment
Share on other sites


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

both my script and euphy quest shop can do the trick ...

  • Upvote 1
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...