Jump to content
  • 0

adding a total price to this code


mirabell

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

hello i got this from euphy post so its not my code credit goes to her or where she got it from. What i need is to tell the member how much is the total cost its going to cost before it actually take money and does the identify.

 

 

<header> {
set .@Price, 100;	// Zeny per identify
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1) {
	if (@inventorylist_identify[.@i]) continue;
	if (Zeny < .@Price) {
		dispbottom "It costs "+.@Price+" to identify an item."; break; }
	set Zeny, Zeny-.@Price;
	delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@i],1;
	setarray .@Total[0], .@Total[0]+1, .@Total[1]+.@Price; }
if (!.@Total[0]) {
	message strcharinfo(0),"No items identified."; end; }
specialeffect2 154;
message strcharinfo(0),"Identified "+.@Total[0]+" items"+((.@Total[1])?" for "+.@Total[1]+" Zeny":"")+".";
end;
}

 

Edited by mirabell
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   127
  • Joined:  04/04/16
  • Last Seen:  

Try this just expand the dialogue.

prontera,156,176,5	script	sdhsh2323f	100,{
mes "[Identifier]";
mes "Hello, would you like to identify all your unidentified items for 200 zeny each?";
next;
getinventorylist;
for( .@i=0; .@i<@inventorylist_count; .@i++ ) {
	if( @inventorylist_identify[.@i] )
		continue;
	.@identify++;
}
if( !.@identify ) {
	mes "[Identifier]";
	mes "You don't have any unidentified item in your inventory.";
	close;
}
mes "[Identifier]";
mes "Found "+.@identify+" unidentified item(s)";
mes "Cost: "+(.@identify*200)+"z";
next;
if( select("Identify All:I'll think about it")&2)close;
if( Zeny < .@identify*200 ) {
	mes "[Identifier]";
	mes "I'm sorry you don't have enough Zeny";
	close;
}
Zeny -= .@identify*200;
atcommand "@identifyall";
mes "[Identifier]";
mes "All your items have been identified!";
close;
}

 

Edited by Technoken
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  107
  • Reputation:   6
  • Joined:  12/09/11
  • Last Seen:  

{
 ** set .@Price, 100;	// Zeny per identify **
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1) {
	if (@inventorylist_identify[.@i]) continue;
	** if (Zeny < .@Price) {
		dispbottom "It costs "+.@Price+" to identify an item."; break; }**
	set Zeny, Zeny-.@Price;
	delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@i],1;
	setarray .@Total[0], .@Total[0]+1, .@Total[1]+.@Price; }
if (!.@Total[0]) {
	message strcharinfo(0),"No items identified."; end; }
specialeffect2 154;
message strcharinfo(0),"Identified "+.@Total[0]+" items"+((.@Total[1])?" for "+.@Total[1]+" Zeny":"")+".";
end;
}

By the first double star you set the price it will cost for the npc to identify for player

second set of double stars this bit "+.@Price+" prints out what you set the price at

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

this i already know... the second start just tells the player how much it cost to identify only 1 item and it tells you after it check to see if you have the zeny to continue.

 

What i ask for was the ability to tell the player how much its going to be, BEFORE it checks.

so like:

if you have 10 unidentified items it would say " you have 10 unidentified items and will cost 1000 zeny"

Edit:

can anyone else help me with this?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  1138
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

prontera,156,176,5	script	PK Points Dealer	100,{
set .@Price, 100;	// Zeny per identify
getinventorylist;
for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1) {
	if (@inventorylist_identify[.@i]) continue;
	if (Zeny < .@Price) {
		mes "It costs "+.@Price+" to identify an item."; break; }
	setarray .@Total[0], .@Total[0]+1, .@Total[1]+.@Price; }
		mes "It costs "+.@Total[1]+" to identify an item.";
	switch(select("Go ahed")) {
	set Zeny, Zeny-.@Price;
	delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
	getitem @inventorylist_id[.@i],1;
}
if (!.@Total[0]) {
	mes strcharinfo(0),"No items identified."; end; }
specialeffect2 154;
message strcharinfo(0),"Identified "+.@Total[0]+" items"+((.@Total[1])?" for "+.@Total[1]+" Zeny":"")+".";
end;
}

test and lemme know if any bug

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

if you have no zeny and use the npc it tell you the cost and if you hit ok the npc freezes and you get stuck. also if you have zeny but not enough it tell you the cost but when it tries to take money it also freezes 

 

Edited by mirabell
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  1138
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

On 4/17/2017 at 10:18 AM, mirabell said:

if you have no zeny and use the npc it tell you the cost and if you hit ok the npc freezes and you get stuck. also if you have zeny but not enough it tell you the cost but when it tries to take money it also freezes 

 

i didnt see this, my bad, and i was sleep head lmao /heh

try this 

prontera,156,176,5	script	Cyro	100,{
if(Zeny < 200) goto no_zeny;
mes "[Identifier]";
mes "Hello, would you like to identify all your unidentified items for 200 zeny each?";
next;
menu "Yes, please!",yes1,"No, thanks.",no1;
yes1:
getinventorylist;
set @identify, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
if (@inventorylist_identify[@i] == 0) set @identify, @identify + 1;
}
if (@identify == 0) goto no_unid;

mes "[Identifier]";
if (@identify < 2)
{
mes "Are you sure you want to identify the "+@identify+" unidentified item in your inventory for "+(@identify * 200)+" zeny?";
}
else
{
mes "Are you sure you want to identify the "+@identify+" unidentified items in your inventory for "+(@identify * 200)+" zeny?";
}
next;
menu "Yes, identify my items!",yes2,"No, thanks.",no2;
yes2:
if(Zeny < 200) goto no_zeny;
getinventorylist;
set @identify, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i +
1)
{
if (@inventorylist_identify[@i] == 0) set @identify,
@identify + 1;
}
if (@identify == 0) goto no_unid;

getinventorylist;
set @identified, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i +
1)
{
if (@inventorylist_identify[@i] == 0)
{
if (Zeny < 200) goto no_zeny;
else set Zeny, Zeny - 200;
delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
getitem @inventorylist_id[@i],1;
set @identified, @identified + 1;
}
}
mes "[Identifier]";
mes "All your items have been identified!";
close;
no1:
mes "[Identifier]";
mes "Please come again soon!";
close;
no2:
mes "[Identifier]";
mes "Please come again soon!";
close;
no_zeny:
mes "[Identifier]";
mes "You don't have enough zeny!";
close;
no_unid:
mes "[Indentifier]";
mes "You don't have any unidentified items!";
close;
no:
mes "[Identifier]";
mes "Please come again soon!";
close;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

4 hours ago, Cyro said:

i didnt see this, my bad, and i was sleep head lmao /heh

try this 


prontera,156,176,5	script	Cyro	100,{
if(Zeny < 200) goto no_zeny;
mes "[Identifier]";
mes "Hello, would you like to identify all your unidentified items for 200 zeny each?";
next;
menu "Yes, please!",yes1,"No, thanks.",no1;
yes1:
getinventorylist;
set @identify, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
if (@inventorylist_identify[@i] == 0) set @identify, @identify + 1;
}
if (@identify == 0) goto no_unid;

mes "[Identifier]";
if (@identify < 2)
{
mes "Are you sure you want to identify the "+@identify+" unidentified item in your inventory for "+(@identify * 200)+" zeny?";
}
else
{
mes "Are you sure you want to identify the "+@identify+" unidentified items in your inventory for "+(@identify * 200)+" zeny?";
}
next;
menu "Yes, identify my items!",yes2,"No, thanks.",no2;
yes2:
if(Zeny < 200) goto no_zeny;
getinventorylist;
set @identify, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i +
1)
{
if (@inventorylist_identify[@i] == 0) set @identify,
@identify + 1;
}
if (@identify == 0) goto no_unid;

getinventorylist;
set @identified, 0;
for(set @i, 0; @i < @inventorylist_count; set @i, @i +
1)
{
if (@inventorylist_identify[@i] == 0)
{
if (Zeny < 200) goto no_zeny;
else set Zeny, Zeny - 200;
delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
getitem @inventorylist_id[@i],1;
set @identified, @identified + 1;
}
}
mes "[Identifier]";
mes "All your items have been identified!";
close;
no1:
mes "[Identifier]";
mes "Please come again soon!";
close;
no2:
mes "[Identifier]";
mes "Please come again soon!";
close;
no_zeny:
mes "[Identifier]";
mes "You don't have enough zeny!";
close;
no_unid:
mes "[Indentifier]";
mes "You don't have any unidentified items!";
close;
no:
mes "[Identifier]";
mes "Please come again soon!";
close;
}

 

hello, it identify now and tells you the amount it cost to identify BUT when taking the zeny it only takes the 200 not the total amount

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  1138
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

2 minutes ago, mirabell said:

hello, it identify now and tells you the amount it cost to identify BUT when taking the zeny it only takes the 200 not the total amount

change this 

if (Zeny < 200) goto no_zeny;
else set Zeny, Zeny - 200;

to

if (Zeny < (@identify * 200)) goto no_zeny;
else set Zeny, Zeny - (@identify * 200);

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

On 4/19/2017 at 2:14 PM, Cyro said:

change this 


if (Zeny < 200) goto no_zeny;
else set Zeny, Zeny - 200;

to


if (Zeny < (@identify * 200)) goto no_zeny;
else set Zeny, Zeny - (@identify * 200);

 

this is so weird it take the zeny but i notice sometime it does not identify everything. it will leave a few behind and still charge the fee.thanks ill have to keep testing and see why it does that

 

Edit:

lol thats what i did, use atcommand. Well thanks for the help , i took a few idea from the code to do the price check and price output and then used atcommand. Thank for hlep

13 hours ago, Technoken said:

Try this just expand the dialogue.


prontera,156,176,5	script	sdhsh2323f	100,{
mes "[Identifier]";
mes "Hello, would you like to identify all your unidentified items for 200 zeny each?";
next;
getinventorylist;
for( .@i=0; .@i<@inventorylist_count; .@i++ ) {
	if( @inventorylist_identify[.@i] )
		continue;
	.@identify++;
}
if( !.@identify ) {
	mes "[Identifier]";
	mes "You don't have any unidentified item in your inventory.";
	close;
}
mes "[Identifier]";
mes "Found "+.@identify+" unidentified item(s)";
mes "Cost: "+(.@identify*200)+"z";
next;
if( select("Identify All:I'll think about it")&2)close;
if( Zeny < .@identify*200 ) {
	mes "[Identifier]";
	mes "I'm sorry you don't have enough Zeny";
	close;
}
Zeny -= .@identify*200;
atcommand "@identifyall";
mes "[Identifier]";
mes "All your items have been identified!";
close;
}

 

 

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