1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
// TMW-2 Script
// Author:
// Jesusalva
// Description:
// Contraband of counterfeit goods.
015-3-3,45,66,0 script Blanc#Contraband NPC_NO_SPRITE,{
// Store not available
if (!.active)
end;
// STORY MODE
setpcblock(PCBLOCK_HARD, true);
mesc l("STORY MODE ENABLED. Monsters won't attack you, so you can read without worries."), 1;
next;
clear;
showavatar NPC_BLANC;
mesn;
mesq l("Hey pal, I am preparing a trip for The Mana World: Classic, which is beyond the mirror lake. Care to sell me contrabanded stuff?");
mesc l("Blanc can purchase account bound items, and exchange named items by non-named items.");
next;
.@id=requestitemindex();
// Collect the item ID and meta data
delinventorylist();
getinventorylist();
.@x=@inventorylist_id[.@id];
.@c1=@inventorylist_card1[.@id];
//.@r=@inventorylist_refine[.@id]; // TODO: Not restore-able without getitem2()
.@gid=getcharid(2);
if (.@gid)
.@admin=(getguildrole(.@gid, getcharid(3)) == GPOS_GUILDMASTER);
else
.@admin=false;
// No duplicates
if (countitem(.@x) > 1) {
mesn;
mesq l("You are carrying duplicates of the same item. Sorry, but I have no idea which one you mean."), 1;
goto L_Close;
}
// Skip equipped items
if (isequipped(.@x)) {
mesn;
mesq l("You should unequip this item first."), 1;
goto L_Close;
}
// Trade restriction from the database
if (getiteminfo(.@x, ITEMINFO_TRADE) & ITR_NOSELLTONPC) {
mesn;
mesq l("Ehm, I count as a NPC, so... you can't contraband items which cannot be sold to NPCs, pal!"), 1;
goto L_Close;
}
mesn;
mesq l("A(n) %s, hm? And what do you want me to do with it?", getitemlink(.@x));
.@price = getiteminfo(.@x, ITEMINFO_SELLPRICE);
select
l("Nothing. Sorry bothering."),
rif(checkbound(.@x, 1), l("I would like to sell it for %s GP.", fnum(.@price*2/3))),
rif(checkbound(.@x, 2) && .@admin, l("I would like to sell it for %s GP.", fnum(.@price*1/3))),
rif(.@c1 >= 252, l("I would like to swap, I offer you %s GP.", fnum(.@price))),
rif(!checkbound(.@x) && !.@c1, l("I would like to sell it for %s GP.", fnum(.@price*11/10)));
switch (@menu) {
case 2:
mesn;
mesq l("Are you sure?");
if (askyesno() == ASK_NO) break;
// Sell account bound items
delitem .@x, 1;
Zeny += .@price * 2 / 3;
mesn;
mesq l("Pleasure doing business with you.");
break;
case 3:
// Sell guild bound items
if (!.@admin) { atcommand("@ban 2d "+strcharinfo(0)); end; } // Anti-Cheat
delitem .@x, 1;
Zeny += .@price * 1 / 3;
mesn;
mesq l("Pleasure doing business with you.");
break;
case 4:
// Remove item name
if (Zeny < .@price) {
mesn;
mesq l("Try to fool another, you broken peniless piece of %s meat!", get_race());
mesc l("%s stabs you, wounding you fatally!", .name$);
die();
goto L_Close;
}
.@o0i = getitemoptionidbyindex(.@id, 0);
.@o0v = getitemoptionvaluebyindex(.@id, 0);
.@o1i = getitemoptionidbyindex(.@id, 1);
.@o1v = getitemoptionvaluebyindex(.@id, 1);
.@o2i = getitemoptionidbyindex(.@id, 2);
.@o2v = getitemoptionvaluebyindex(.@id, 2);
.@o3i = getitemoptionidbyindex(.@id, 3);
.@o3v = getitemoptionvaluebyindex(.@id, 3);
.@o4i = getitemoptionidbyindex(.@id, 4);
.@o4v = getitemoptionvaluebyindex(.@id, 4);
Zeny -= .@price;
delitem .@x, 1;
CsysNpcCraft(.@x, .@o0i, .@o0v, .@o1i, .@o1v,
.@o2i, .@o2v, .@o3i, .@o3v, .@o4i, .@o4v);
// Refine by .@r
//for (.@i=0;.@i<.@r;.@i++) {
//}
mesn;
mesq l("Eh, sure, you can have this %s. It is not refined but should do the trick. Maybe. NO REFUNDS!", getitemlink(.@x));
break;
case 5:
// Regular item sale
delitem .@x, 1;
Zeny += .@price * 11 / 10;
mesn;
mesq l("Pleasure doing business with you.");
break;
}
goto L_Close;
L_Close:
next;
closeclientdialog;
setpcblock(PCBLOCK_HARD, false);
close;
// Load
OnMinute21:
OnMinute46:
setnpcdisplay .name$, NPC_BLANC;
.active=1;
end;
// Unload
OnMinute23:
OnMinute48:
setnpcdisplay .name$, NPC_NO_SPRITE;
.active=0;
end;
OnInit:
.active=0;
.sex = G_OTHER;
.distance = 3;
/*
if (debug) {
setnpcdisplay .name$, NPC_BLANC;
.active=1;
}
*/
end;
}
|