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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
// TMW-2 Scripts.
// Author:
// Jesusalva
// Description:
// Manages party and guild.
// General_Guild
// 0 - Allows Party Creation
// 1 - Allows Guild Creation, Party is already allowed
// Evol scripts.
// Author:
// Reid
003-2,32,34,0 script Estard NPC_PLAYER,{
function create_party {
.@party_price = 6500;
.@party_price-=reputation("Candor")*10;
.@party_price-=reputation("Tulim")*10;
.@party_price-=reputation("Hurns")*10;
.@party_price-=reputation("Nival")*10;
.@party_price-=reputation("Halin")*10;
.@party_price-=reputation("LoF")*10;
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
l("Creating a party has some advantages, it's a pretty good choice!"),
l("If the members level difference is less than 30, and you enable exp sharing, you'll all get a bonus experience!"),
l("You also get access to a party chat, and there are no compromises, so it is a perfect choice for a raid."),
lg("The cost to create a party is @@ GP, are you interested?",
"The cost to create a party is @@ GP, are you interested?", .@party_price);
if (askyesno() == ASK_YES) {
if (Zeny < .@party_price) {
speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("You don't have enough money, bring me @@ GP.", .@party_price);
} else {
Zeny = Zeny - .@party_price;
setq General_Guild, 1;
skill NV_BASIC, 7, 0;
getexp 0, 100;
speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Awesome, come back if you ever want to create a larger group!");
}
}
}
function create_guild {
.@guild_price = 50000;
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
l("Creating a guild is not for the faint of heart. You cannot share experience or drops."),
l("But it is a massive organization, recognized by everyone. Guilds train with other guilds, for huge profits."),
l("It is often easier to get invited by someone, but if you want to create it, you're free to. Remember guilds also have a player limit."),
l("Just like parties, you can create from Social menu, but there is a catch: I will give you a document, which allows you to create ONE GUILD."),
l("Shall you disband your guild for whatever reason, you'll need to pay again. No refunds. No complaining."),
l("The cost to create a guild is @@ GP.", .@guild_price);
if (askyesno() == ASK_YES) {
if (Zeny < .@guild_price) {
speech S_FIRST_BLANK_LINE | S_LAST_NEXT, l("You don't have enough money, bring me @@ GP or join an already existing one.", .@guild_price);
} else {
inventoryplace Emperium, 1;
Zeny = Zeny - .@guild_price;
getitem Emperium, 1;
getexp 0, 1000;
speech(S_FIRST_BLANK_LINE | S_LAST_NEXT, l("Awesome, here is the certificate! Choose guild name wisely, because there are no refunds, even if you lose it!"));
}
}
}
function explain_service {
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
l("Welcome to the Town Hall. I am @@, officer in charge of public associations.", .name$),
l("We offer party and guild certifications.");
return;
}
function gstorage {
closedialog;
guildopenstorage();
close;
return;
}
function gmaster {
.@gid=getcharid(2);
mesn;
mesc l("Please select the Guild Position you want to change.");
menuint
l("Abort"), -1,
l("Guild Master"), GPOS_GUILDMASTER,
l("Vice Leader"), GPOS_VICELEADER,
l("Recruiter"), GPOS_RECRUITER,
l("Position 4"), GPOS_4,
l("Position 5"), GPOS_5,
l("Newbie"), GPOS_NEWBIE;
mes "";
.@idx=0+@menuret;
if (.@idx < 0)
return;
mesc l("Please write how much in percent is EXP Tax for member (range: 0~50)"), 1;
input .@exptax;
if (.@exptax < 0 || .@exptax > 50)
return;
mesc l("Applying...");
switch (.@idx) {
case GPOS_GUILDMASTER:
.@name$="GuildMaster";
.@perm=GPERM_ALL;
break;
case GPOS_VICELEADER:
.@name$="ViceLeader";
.@perm=GPERM_ALL;
break;
case GPOS_RECRUITER:
.@name$="Recruiter";
.@perm=GPERM_INVITE;
break;
case GPOS_NEWBIE:
.@name$="Newbie";
.@perm=0;
break;
default:
.@name$="Position "+(.@idx+1);
.@perm=0;
break;
}
debugmes "sgr(%d,%d,%d,%d,\"%s\")", .@gid, .@idx, .@perm, .@exptax, .@name$;
.@re=setguildrole(.@gid, .@idx, .@perm, .@exptax, .@name$);
mesc l("Done"), 3;
debugmes "Result: %d", .@re;
return;
}
function ginfo {
.@gid=getcharid(2);
mesn;
mesc l("You are on guild @@ - @@", .@gid, getguildname(.@gid));
next;
mesc l("Your guild is lv @@", getguildlvl(.@gid));
mesc l("@@ / @@ EXP", getguildexp(.@gid), getguildnxp(.@gid));
next;
mesc l("The average player level is @@", getguildavg(.@gid));
mesc l("@@ is the guild master.", getguildmaster(.@gid));
next;
mesc l("Get 100,000 GExp?"), 1;
if (askyesno() == ASK_YES) {
mes "";
guildgetexp(100000);
mesc l("Done");
next;
mesc l("Your guild is lv @@", getguildlvl(.@gid));
mesc l("@@ / @@ EXP", getguildexp(.@gid), getguildnxp(.@gid));
next;
}
mes "";
mesn;
mesc l("These are all guild info commands atm. Let's use mapreg now?");
next;
getguildinfo(.@gid);
mesn;
mesc l("Your guild is lv @@ and average player level is @@", $@guildinfo_lvl[.@gid], $@guildinfo_avg[.@gid]);
next;
return;
}
mesn;
mesq lg("Welcome miss.", "Good day sir.");
//if (getcharid(1) > 0)
// mes l("You're in the \"@@\" party, I know!", getpartyname(getcharid(1)));
if (getcharid(2) > 0)
mesq l("You are part of the \"@@\" guild.", getguildname(getcharid(2)));
next;
do
{
select
l("What service do you offer?"),
rif(!getq(General_Guild), l("I would like to create a party.")),
rif(getq(General_Guild) && getcharid(2) <= 0 && countitem(Emperium) == 0, l("I would like to create a guild.")),
rif(getq(General_Guild) && getcharid(2) > 0, l("I would like to open Guild Storage.")),
rif(is_admin() && getcharid(2) > 0, l("I would like to read Guild Information.")),
rif(is_admin() && getcharid(2) > 0, l("I would like to edit Roles.")),
menuaction(l("Quit"));
switch (@menu)
{
case 1:
explain_service;
break;
case 2:
create_party;
break;
case 3:
create_guild;
break;
case 4:
gstorage;
break;
case 5:
ginfo;
break;
case 6:
gmaster;
break;
}
} while (@menu < 7);
closedialog;
goodbye;
close;
OnInit:
.@npcId = getnpcid(.name$);
setunitdata(.@npcId, UDT_HEADTOP, BowlerHat);
setunitdata(.@npcId, UDT_HEADMIDDLE, CreasedShirt);
setunitdata(.@npcId, UDT_HEADBOTTOM, JeansChaps);
setunitdata(.@npcId, UDT_WEAPON, 1800);
setunitdata(.@npcId, UDT_HAIRSTYLE, 26);
setunitdata(.@npcId, UDT_HAIRCOLOR, 0);
npcsit;
.sex = G_MALE;
.distance = 4;
end;
}
|