Jump to content

Recommended Posts

Posted (edited)
Error on mvp ladder. Im using eA emulator!
The version I posted here will work only on rAthena.

Anyway, thanks for your script collection Euphy ^_^

Edited by nanakiwurtz
Posted (edited)

Btw, not sure why It couldn't work with your quest shop, I got bugged when enabled both. All those shops only show Jellopy/Apple for no reason.

Edit: Figured out, it's the OnInit problem :P

Edited by darristan
Posted

Hunting Missions updated to v1.1. Mostly small things, the most important being delay calculation and a matching monster name check (ex. so you don't get multiple Goblins to hunt).

Posted

@Vanyrl: That's a very good point. In v1.1a, NPC kills now compare monster name instead of monster ID (so killing any Goblin will count, for example). Thanks for the idea!

Posted

@angelakied: Answer is already posted multiple times - find&replace "qshop" with a different name.

@Vitrue: I pretty much copied my "Multi-Shop" script's code, so you can use that as a base to add more shops. To remove exp rewards, well, delete those lines.

Posted

well, i am a little lost at this part

OnBuyItem:
   set @cost,0;
   for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
       for(set .@j,0; .@j<getarraysize(.Shop); set .@j,.@j+2)
           if (@bought_nameid[.@i] == .Shop[.@j]) {
               set @cost, @cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
               break;
           }
   mes "[Hunting Missions]";
   if (@cost > #Mission_Points) mes "You don't have enough Mission Points.";
   else {
       for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
           getitem @bought_nameid[.@i], @bought_quantity[.@i];
           dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";
       }
       set #Mission_Points, #Mission_Points-@cost;
       mes "Deal completed.";
       emotion e_cash;
   }
   set @cost,0;
   deletearray @bought_nameid[0], getarraysize(@bought_nameid);
   deletearray @bought_quantity[0], getarraysize(@bought_quantity);
   close;

and this

    setarray .Shop[0],    // Reward items: <ID>,<point cost> (about 10~20 points per hunt).
       20205,145,20206,145,20207,145,20208,145;

i have successfully removed the exp rewards tho. now do i need to make new arrays for the new shop if i am adding? or ?

Posted

@Vitrue: Here are the changes --

	case 5:
	set @s, select(implode(.Names$,":"));
	//...
	callshop "mission_shop"+@s,1;
	npcshopattach "mission_shop"+@s;
	end;

OnBuyItem:
for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
	for(set .@j,0; .@j<getarraysize(getd(".Shop"+@s)); set .@j,.@j+2)
		if (getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
			set @cost, @cost+(getd(".Shop"+@s+"["+(.@j+1)+"]")*@bought_quantity[.@i]);
			break;
		}

OnInit:
// new shop arrays (be sure to rename the first one)
setarray .Shop1[0],1202,5,1229,20;
setarray .Shop2[0],5116,15;
setarray .Names$[0],"Weapons","Headgears";

for(set .@i,1; .@i<=getarraysize(.@Names$); set .@i,.@i+1) {
	npcshopdelitem "mission_shop"+.@i,512;
	for(set .@j,0; .@j<getarraysize(getd(".Shop"+.@i)); set .@j,.@j+2)
		npcshopadditem "mission_shop"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
}
end;
}
// duplicate shops as necessary
-	shop	mission_shop1	-1,512:-1
-	shop	mission_shop2	-1,512:-1

  • Upvote 1
Posted

@jysn: It's not possible, since quest entries are hardcoded in a database. You could theoretically convert all the possible combinations into quest_db entries; it'd be a lot of entries, though. xD

Posted

I just want to report something about the MVP Ladder. There's an error (on line 14 of the script)

[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: getmapxy (4 parameters):
[Debug]: Data: variable name='.@a00000$' index=0
[Debug]: Data: variable name='.@a00001' index=0
[Debug]: Data: variable name='.@a00002' index=0
[Debug]: Data: number value=0

:)

Posted

@Vitrue: Here are the changes --

 case 5:
set @s, select(implode(.Names$,":"));
//...
callshop "mission_shop"+@s,1;
npcshopattach "mission_shop"+@s;
end;

OnBuyItem:
for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
       for(set .@j,0; .@j<getarraysize(getd(".Shop"+@s)); set .@j,.@j+2)
           if (getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
               set @cost, @cost+(getd(".Shop"+@s+"["+(.@j+1)+"]")*@bought_quantity[.@i]);
               break;
           }

OnInit:
   // new shop arrays (be sure to rename the first one)
   setarray .Shop1[0],1202,5,1229,20;
   setarray .Shop2[0],5116,15;
   setarray .Names$[0],"Weapons","Headgears";

   for(set .@i,1; .@i<=getarraysize(.@Names$); set .@i,.@i+1) {
       npcshopdelitem "mission_shop"+.@i,512;
       for(set .@j,0; .@j<getarraysize(getd(".Shop"+.@i)); set .@j,.@j+2)
           npcshopadditem "mission_shop"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
   }
   end;
}
// duplicate shops as necessary
-    shop    mission_shop1    -1,512:-1
-    shop    mission_shop2    -1,512:-1

oh itworked but after reloading many times it just shows an apple. i didn't try it before thats why i am only telling this now

Posted (edited)

can anyone help me remove the apple in multiple-shop script?

// -------------------- Config 1 --------------------
// For each shop added, copy this MSHOPX dummy data.
// Write your shop names in the select() function.

-	shop	MSHOP1	-1,512:-1
-	shop	MSHOP2	-1,512:-1

prontera,148,169,4    script    A Shop    984,{

set @s, select("MVP Cards:God Items");

// --------------------------------------------------

message strcharinfo(0),"This shop only accepts"+getitemname(.Currency[@s])+".";
dispbottom "You have "+countitem(.Currency[@s])+""+getitemname(.Currency[@s])+".";
callshop "MSHOP"+@s,1;
npcshopattach "MSHOP"+@s;
end;

OnBuyItem:
set .@i,0;
while (.@i < getarraysize(@bought_nameid)) {
	set .@j, 0;
	while (.@j < getarraysize(getd(".Shop"+@s))) {
		if(getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
			set @itemcost, (getd(".Shop"+@s+"["+(.@j+1)+"]") * @bought_quantity[.@i]);
			set @totalcost, @totalcost +@itemcost;
			break; }
	set .@j, .@j+2; }
set .@i, .@i+1; }
if (@totalcost > countitem(.Currency[@s])) dispbottom "You don't have enough "+getitemname(.Currency[@s])+".";
else {
	set .@i,0;
	while (.@i < getarraysize(@bought_nameid)) {
		getitem @bought_nameid[.@i], @bought_quantity[.@i];
		dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";
	set .@i, .@i+1; }
delitem .Currency[@s], @totalcost; }
set @totalcost, 0;
deletearray @bought_nameid[0], 128;
deletearray @bought_quantity[0], 128;
end;

OnInit:

// -------------------- Config 2 --------------------
// Currency:  The ID of each shop currency,
//	in the same order as the shops.
// Shop order follows that of the select() call,
//   and is formatted "ID1,Count1,ID2,Count2,..."

setarray .Currency[1],7227,7227,7227,7227,7227,7227,7227,7227;
setarray .Shop1[0],4399,3,4305,3,4302,3,4174,3,4047,2,4143,2,4330,2,4121,1;
setarray .Shop2[0],5013,25,2410,25,2629,25,2541,25,2383,20,2630,20,1530,20;

// --------------------------------------------------

set .@i,1;
while (.@i <= getarraysize(.Currency)) {
	set .@j,0;
	while (.@j < getarraysize(getd(".Shop"+.@i))) {
		npcshopdelitem "MSHOP"+.@i,7227;
		npcshopadditem "MSHOP"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
	set .@j, .@j+2; }
set .@i, .@i+1; }
end;
}

Edited by Euphy
Codeboxed

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...