Jump to content
  • 0

[Request] Multi Quest NPC with attached Cash Shop as Preview


Zagreuz

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

Multi Quest NPC with attached Cash Shop as Preview

, as per start's here's some screen shot about the preview :

midgear_quest.png

with the picture above, upon using the npc, player will have 2 choices, as in to directly make the quest gears, [ Make! ] or to see the gears first using [Preview!] as upon clicking [Preview!] i will call a cash shop that will list all the quest gears but cannot be buyed directly because we have set the cash point relatively so that player wont be able to buy just to preview the item,

upon clicking the [Make!] the player can view all the list of gear before start to pick and learn the quest item that need to be collected. <- as usuall questing procedure.

or maybeeee . . . someone already had an npc like this, care to share ? :( it's kinda like Dynamic Quest npc with cash shop as preview :(

Link to comment
Share on other sites

8 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  254
  • Topics Per Day:  0.06
  • Content Count:  825
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

ow sorry. wrong post.

that is pods donation npc with preview.

here's dynamic quest npc.

-    shop    quest_shop    -1,501:50
turbo_room,119,87,5,    script    Dynamic Quest NPC    899,{
set @i,0;
mes "[shop Quest NPC]";
mes "Which item do you wish to obtain?";
mes "Select only one.";
callshop "quest_shop",1;
npcshopattach "quest_shop";
end;

OnBuyItem:
 if(.BuildQuest) {
   for(set .e,0; !compare(getarg(.e+1) + "","Zeny"); set .e,.e+2) {}
   npcshopadditem "quest_shop",getarg(.e+2),getarg(.e)*compare(getarg(.e+1) + "","SZeny");
   setarray .Shop[.i],getarg(.e+2);
   set .i,.i+1;
   goto Quest_Setup;
 }
 if(.Shop[@i]!=@bought_nameid) for(set @i,1; 1; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set .i,@i; callsub Quest_Setup; }
 for(set @i,1; !@e; set @i,@i+1) if(.Shop[@i]==@bought_nameid) { set @e,1; set .i,@i; callsub Quest_Setup; }
 mes "[shop Quest NPC]";
 mes "I require the following:";
 for(set @i,0; !compare(getarg(@i+1) + "","Zeny"); set @i,@i+2) mes "^FF0000" + ((countitem(getarg(@i))>=getarg(@i+1))? "^00FF00":"") + "" + getarg(@i+1) + " " + getitemname(getarg(@i)) + " [" + countitem(getarg(@i)) + "/" + getarg(@i+1) + "]";
 if(getarg(@i)) mes "^FF0000" + ((Zeny>=getarg(@i))? "^00FF00":"") + "" + getarg(@i) + " Zeny";
 mes "^000000In exchange, I will give you:^0000FF";
 for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) mes getarg(@i+1) + " " + getitemname(getarg(@i));
 switch(select("Exchange:" + (((((getiteminfo(@bought_nameid,5) & 1) || (getiteminfo(@bought_nameid,5) & 256) || (getiteminfo(@bought_nameid,5) & 512)) && @equip==0))? "Preview Item":"") + ":No thanks")) {
   case 1:
  for(set @i,0; !compare(getarg(@i+1) + "","Zeny"); set @i,@i+2) if(countitem(getarg(@i)) < getarg(@i+1)) {
    next;
    mes "You have " + countitem(getarg(@i)) + " " + getitemname(getarg(@i)) + ", while I require " + getarg(@i+1) + ".";
    mes "Please obtain ^FF0000" + (getarg(@i+1)-countitem(getarg(@i))) + " more " + getitemname(getarg(@i)) + "^000000.";
    close;
  }
  if(Zeny < getarg(@i)) {
    next;
    mes "You do not have enough Zeny.";
    mes "Please obtain ^FF0000" + (getarg(@i)-Zeny) + " more Zeny^000000.";
    close;
  }
  for(set @i,0; !compare(getarg(@i+1) + "","Zeny"); set @i,@i+2) delitem getarg(@i),getarg(@i+1);
  set Zeny,Zeny-getarg(@i);
  for(set @i,@i+2; getarg(@i+1,0); set @i,@i+2) getitem getarg(@i),getarg(@i+1);
  if (compare(getarg(@i,0) + "","announce")) announce strcharinfo(0) + " has just obtained " + getitemname(@bought_nameid) + "!",bc_all;
  close;
   case 2:
  set @bottomview, getlook(3);
  set @topview, getlook(4);
  set @midview, getlook(5);
  addtimer 1000, strnpcinfo(3)+"::On_Leave";
  set @equip,getiteminfo(@bought_nameid, 5);
  set @view, getiteminfo(@bought_nameid, 11);
  if(@equip != -1 && @view > 0) {
    if(@equip & 1) atcommand "@changelook 3 " + @view;
    if(@equip & 256) atcommand "@changelook 1 " + @view;
    if(@equip & 512) atcommand "@changelook 2 " + @view;
  }
  next;
  goto OnBuyItem;
  case 3:
  close;
 }
On_Leave:
 atcommand "@changelook 1 " + @topview;
 atcommand "@changelook 2 " + @midview;
 atcommand "@changelook 3 " + @bottomview;
 set @equip,0;
 set @view,0;
 set @topview,0;
 set @midview,0;
 set @bottomview,0;
 end;
OnInit:
 npcshopdelitem "quest_shop",501;
 set .BuildQuest,1;
 set .i,1;
 Quest_Setup:
 switch(.i) {
   default: set .BuildQuest,0; set .e,0; set .i,0; end;
           case 1: callsub OnBuyItem,7206,1,742,1,752,1,7212,1,7268,1,7277,1,741,1,754,1,743,1,753,1,750,1,751,1,1000000,"SZeny",2630,1,"announce";
       case 2: callsub OnBuyItem,7179,100,2223,1,978,2,982,5,7063,300,1000000,"SZeny",5379,1,"announce";
       case 3: callsub OnBuyItem,7179,100,2268,1,7114,10,7035,1,6023,10,1000000,"SZeny",5377,1,"announce";
       case 4: callsub OnBuyItem,7179,200,7798,20,6022,3,7108,10,7799,10,7562,2,7450,5,1000000,"SZeny",1530,1,"announce";
       case 5: callsub OnBuyItem,7179,100,5003,1,641,200,983,1,1020,200,737,100,1000000,"SZeny",30129,1,"announce";
       case 6: callsub OnBuyItem,7179,10,7226,8,1061,100,7188,1000,1095,1000,7036,6,7300,10,727,20,7450,3,1000000,"SZeny",4145,1,"announce";
       case 7: callsub OnBuyItem,7179,30,5493,1,7222,500,1061,400,1000000,"SZeny",5138,1,"announce";
       case 8: callsub OnBuyItem,5305,1,7022,2,7207,100,7066,2000,12374,200,6089,6,674,20,1000000,"SZeny",30064,1,"announce";
       case 9: callsub OnBuyItem,7214,200,939,200,7015,5,2280,1,1000000,"SZeny",30018,1,"announce";
       case 10: callsub OnBuyItem,7298,150,712,500,521,500,1000000,"SZeny",5303,1,"announce";
       case 11: callsub OnBuyItem,723,5,728,25,733,100,969,150,7095,500,2235,1,1000000,"SZeny",5396,1,"announce";
       case 12: callsub OnBuyItem,7511,250,7340,100,7023,100,5131,1,1000000,"SZeny",5363,1,"announce";
       case 13: callsub OnBuyItem,4351,200,4350,200,4349,200,4348,200,4347,200,4346,200,1000000,"SZeny",5536,1,"announce";
       case 14: callsub OnBuyItem,7340,100,7020,5,2235,1,7568,2500,923,250,1000000,"SZeny",5564,1,"announce";
       case 15: callsub OnBuyItem,7063,500,970,200,982,15,2254,15,1000000,"SZeny",5210,1,"announce";
       case 16: callsub OnBuyItem,983,30,2202,2,914,500,7063,500,7298,200,1000000,"SZeny",5401,1,"announce";
       case 17: callsub OnBuyItem,1040,200,949,500,916,500,7115,500,2286,1,1000000,"SZeny",5402,1,"announce";
       case 18: callsub OnBuyItem,705,700,706,10,1019,500,7151,200,1000000,"SZeny",5596,1,"announce";
       case 19: callsub OnBuyItem,1013,500,7097,500,5064,500,969,1000,1000000,"SZeny",5463,1,"announce";
       case 20: callsub OnBuyItem,923,1000,1038,1000,969,1000,978,100,7179,300,1000000,"SZeny",5518,1,"announce";
       case 21: callsub OnBuyItem,7097,500,2678,1,4430,1,7122,300,1000000,"SZeny",5421,1,"announce";        
 }
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

BUMP ~

*anyone ? :<

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  254
  • Topics Per Day:  0.06
  • Content Count:  825
  • Reputation:   3
  • Joined:  11/14/11
  • Last Seen:  

this is not my work but i want to help you. try this script.

this is working on my 2 servers.

if you have any question just post it here. thanks

//=========================================
//=========================================
- shop dyn_shop2 -1,501:50
//=========================================

ra_temsky,48,153,4 script Donation Shop#2 789,{
mes "Your Donation Coupon-->["+countitem(.Cost)+"]";
close2;
callshop "dyn_shop"+.a,1;
npcshopattach "dyn_shop"+.a;
end;
OnInit:
set .a,strnpcinfo(2);
//=========================================
set .Cost,30151;
//=========================================
setarray .buy_id[0],5013,30000,30017,30008,30012,2629,2410,30096,30094,30093,30092,30095,30099,30113,30084,30088,30004,30006;
setarray .buy_co[0],300,500,300,500,500,300,250,200,500,250,500,350,250,350,250,250,200,500;
//=========================================

npcshopitem "dyn_shop2",.buy_id[0],.buy_co[0];
for(set .ik,1;.ik<getarraysize(.buy_id);set .ik,.ik+1){
npcshopadditem "dyn_shop"+.a,.buy_id[.ik],.buy_co[.ik];
}
end;

OnBuyItem:
getinventorylist;
if(@bought_quantity[@i] <= 0){
goto OnEnrd;
end;
}
for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){
//KeyWorld
set .@type, getiteminfo( @bought_nameid[.@i], 2 );
if (  .@type == 4 || .@type == 5 || .@type == 7 || .@type == 8 )
set .@count, .@count + 1;
else {
for( set .@j,0; .@j<@inventorylist_count; set .@j, .@j+1 )
if ( @inventorylist_id[.@i] == @bought_nameid[.@i] )
break;
if ( .@j == @inventorylist_count )
set .@count, .@count+1 ;
}
for(set @i2,0;@i2<getarraysize(.buy_id);set @i2,@i2+1){
if(@bought_nameid[@i]==.buy_id[@i2]){
set @gh,@gh+.buy_co[@i2]*@bought_quantity[@i];
set @wh,@wh+getiteminfo(@bought_nameid[@i],6)*@bought_quantity[@i];
}
}
}
if ( .@count + @inventorylist_count > 100 ) {
announce "[D-Shop]: Can't hold more than 100 items.",bc_self;
goto OnEnrd;
}
if(countitem(.Cost)<@gh){
announce "You do not have enough Reunited Donation Ticket.",bc_self;
announce "Contact * ADMIN * and try to donate.",bc_self;
goto OnEnrd;
end;
}else{
if(@wh>(MaxWeight-Weight)){
announce "[D-Shop]:Too heavy",bc_self;
goto OnEnrd;
end;
}else{
delitem .Cost,@gh;
for(set @i,0;@i<getarraysize(@bought_nameid);set @i,@i+1){
getitem @bought_nameid[@i],@bought_quantity[@i];
}
}
}
OnEnrd:
set @gh,0;
set @wh,0;
set @i,0;
set @i2,0;
deletearray @bought_quantity,getarraysize(@bought_quantity);
deletearray @bought_nameid,getarraysize(@bought_nameid);
end;
}

Edited by Hatake Kakashi
Link to comment
Share on other sites


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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

hmm, kinda confusing, the idea is a simple multi gear quest npc, that had an attached cash shop , did the script that Hatake give has the fuction of multiple quest ?

Edited by LordOfHeRO
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  81
  • Reputation:   5
  • Joined:  11/19/11
  • Last Seen:  

but the script that you're giving is kinda like an donation npc, that's need somekind of POD before buying upon it :<

Link to comment
Share on other sites


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

Have you tried this ? /heh

just edit the items lists...

use the original one if you dont want it use CashPoints ( Default is Zeny )

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