Сообщений: 32
Тем: 5
Зарегистрирован: Jul 2012
Репутация:
0
Привет всем, в общем я использую сборку L2J Freya и у меня есть несколько вопросов по комьюнити... Начну с первого: к себе в комьюнити я приделал бафера, он у меня состоит из 2-х страниц (будет 4). Что нужно сделать что бы после бафа, например на второй странице, не кидало на первую?
P.S. исходники есть, но в яве не силён - стаж ~1 месяц
Сообщений: 5,670
Тем: 145
Зарегистрирован: Nov 2008
Репутация:
33,771
Байпасс самого бафа покажите.
Сообщений: 32
Тем: 5
Зарегистрирован: Jul 2012
Репутация:
0
это?
<img src=icon.skill1077 width=32 height=32><button value="Focus" action="bypass -h _bbs_buff_Focus_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
Сообщений: 5,670
Тем: 145
Зарегистрирован: Nov 2008
Репутация:
33,771
Ещё бы код обработки байпасса _bbs_buff_Focus_ из java класса бафера в КБ.
Сообщений: 527
Тем: 17
Зарегистрирован: Oct 2010
Репутация:
1,919
BymerOK Написал:это?
<img src=icon.skill1077 width=32 height=32><button value="Focus" action="bypass -h _bbs_buff_Focus_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
А лучше бы передавать айди эффекта а не название. + в сам вызов можно поместить номер страницы на которую возвращается, т.е. bypass -h _bbs_buff_Focus_ 2.
Сообщений: 32
Тем: 5
Зарегистрирован: Jul 2012
Репутация:
0
07-25-2012, 11:54 AM
(Сообщение последний раз редактировалось: 07-25-2012, 09:42 PM BymerOK.)
Проще сделать так: в общем эта комьюнити от surfacing, вот http://forum.zone-game.info/showthread.p...+community так будет удобнее самим посмотреть что и как
Добавлено через 9 часов 47 минут
ну что? кто нибудь знает что нужно изменить?
Сообщений: 32
Тем: 5
Зарегистрирован: Jul 2012
Репутация:
0
проблема актуальна
Сообщений: 1,053
Тем: 33
Зарегистрирован: Sep 2011
Репутация:
12,172
Сообщений: 32
Тем: 5
Зарегистрирован: Jul 2012
Репутация:
0
07-26-2012, 12:39 PM
(Сообщение последний раз редактировалось: 07-26-2012, 12:50 PM BymerOK.)
L2CCCP, чего именно?
Добавлено через 11 минут
Добавлено через 8 минут
вот код первой странички бафов
открыть
PHP код: <?php
<html>
<body>
<center>
<table>
<tr>
<td><button value="О Сервере" action="bypass -h _bbstop" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Магазин" action="bypass -h _bbstop;30" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Баффы" action="bypass -h _bbstop;60" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Телепорт" action="bypass -h _bbstop;50" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Карьера" action="bypass -h _bbsclass;" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Новости" action="bypass -h _bbstop;40" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Крафт" action="bypass -h _bbstop;70" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=600 height=1>
<table width=600 bgcolor=CCCCCC>
<tr><td width=200>
<a action="bypass -h _bbstop"><font color=F2C202>PvP Masters</font></a>
<font color=F2C202> -> </font>
<a action="bypass -h _bbstop;60"><font color=F2C202>Баффы</font></a>
</td><td width=400 align=left>
<font color=D70000>Все бафы бесплатны</font>\<font color=D70000>И даже сохранение!</font>
</td></tr>
</table>
<img src="L2UI.SquareWhite" width=600 height=1>
<table width=600>
<tr>
<td height=300>
<center>
<br>
<img src="L2UI.SquareWhite" width=340 height=1>
<table width=350>
<tr>
<td><center><button value="<< back" action="bypass -h _bbstop;603" width=90 height=18 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
<td><center><font color=F2C202>Page 1</font></center></td>
<td><center><button value="next >>" action="bypass -h _bbstop;601" width=90 height=18 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=340 height=1>
</center>
<table width=300>
<tr>
<td align=center>
<img src=icon.skill1077 width=32 height=32><button value="Focus" action="bypass -h _bbs_buff_Focus_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1242 width=32 height=32><button value="D. Whisper" action="bypass -h _bbs_buff_Death Whisper_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1303 width=32 height=32><button value="Wild Magic" action="bypass -h _bbs_buff_Wild Magic_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1086 width=32 height=32><button value="Haste" action="bypass -h _bbs_buff_Haste_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1240 width=32 height=32><button value="Guidance" action="bypass -h _bbs_buff_Guidance_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1087 width=32 height=32><button value="Agility" action="bypass -h _bbs_buff_Agility_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<img src=icon.skill1045 width=32 height=32><button value="Bles. Body" action="bypass -h _bbs_buff_Blessed Body_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1048 width=32 height=32><button value="Bles. Soul" action="bypass -h _bbs_buff_Blessed Soul_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1085 width=32 height=32><button value="Acumen" action="bypass -h _bbs_buff_Acumen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1257 width=32 height=32><button value="Dec. Weight" action="bypass -h _bbs_buff_Decrease Weight_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1068 width=32 height=32><button value="Might" action="bypass -h _bbs_buff_Might_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1059 width=32 height=32><button value="Empower" action="bypass -h _bbs_buff_Empower_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<img src=icon.skill1040 width=32 height=32><button value="Shield" action="bypass -h _bbs_buff_Shield_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1036 width=32 height=32><button value="M. Barrier" action="bypass -h _bbs_buff_Magic Barrier_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1268 width=32 height=32><button value="Vamp. Rage" action="bypass -h _bbs_buff_Vampiric Rage_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1204 width=32 height=32><button value="Wind Walk" action="bypass -h _bbs_buff_Wind Walk_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1062 width=32 height=32><button value="Ber. Spirit" action="bypass -h _bbs_buff_Berserker Spirit_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1397 width=32 height=32><button value="Clarity" action="bypass -h _bbs_buff_Clarity_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<img src=icon.skill1332 width=32 height=32><button value="Bles.Seraphim" action="bypass -h _bbs_buff_Blessing of Seraphim_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1332 width=32 height=32><button value="Gift Seraphim" action="bypass -h _bbs_buff_Gift of Seraphim_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1331 width=32 height=32><button value="Bles.Queen" action="bypass -h _bbs_buff_Blessing of Queen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1331 width=32 height=32><button value="Gift Queen" action="bypass -h _bbs_buff_Gift of Queen_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1388 width=32 height=32><button value="G. Might" action="bypass -h _bbs_buff_Greater Might_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<img src=icon.skill1389 width=32 height=32><button value="G. Shield" action="bypass -h _bbs_buff_Greater Shield_ $tvari" width=80 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
</tr>
</table>
</td>
<td height=300>
<center>
<table width="300">
<tr>
<td><center><font color=3293F3>Операции</font></center></td>
</tr>
</table>
</center>
<center>
<table width="300" align=center>
<tr>
<td align=center><button value="Набор для война" action="bypass -h _bbsbuff;grp;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Все Songs" action="bypass -h _bbsbuff;grp;4; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center><button value="Набор для мага" action="bypass -h _bbsbuff;grp;2; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
<td align=center><button value="Все Dances" action="bypass -h _bbsbuff;grp;3; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
</tr>
<tr>
<td align=center>
<table>
<tr>
<td align=center>
<button value="Сохранить" action="bypass -h _bbsbuff;save" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<button value="Вернуть" action="bypass -h _bbsbuff;restore" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
</tr>
<tr>
<td align=center>
<button value="Сброс" action="bypass -h _bbsbuff;cancel" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<button value="Мана" action="bypass -h _bbsbuff;regmp" width=70 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
</tr>
</table>
</td>
<td align=center>
<font color=3293F3>Кого бафать:</font>
<combobox width=145 var="tvari" list="Player;Pet">
</td>
</tr>
</table>
</center>
<br>
<center>
<table width="300">
<tr>
<td>
<center><font color=3293F3>Song & Dance</font></center>
</td>
</tr>
</table>
<table width="300">
</center>
<center>
<tr>
<td align=center>
<button value="Song of Earth" action="bypass -h _bbsbuff;buff;60;264;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Life" action="bypass -h _bbsbuff;buff;60;265;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Warding" action="bypass -h _bbsbuff;buff;60;267;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Wind" action="bypass -h _bbsbuff;buff;60;268;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Hunter" action="bypass -h _bbsbuff;buff;60;269;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Vitality" action="bypass -h _bbsbuff;buff;60;304;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Renewal" action="bypass -h _bbsbuff;buff;60;349;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Song of Meditation" action="bypass -h _bbsbuff;buff;60;363;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
<td align=center>
<button value="Song of Champion" action="bypass -h _bbsbuff;buff;60;364;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of the Mystic" action="bypass -h _bbsbuff;buff;60;273;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of Concentration" action="bypass -h _bbsbuff;buff;60;276;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Siren's Dance" action="bypass -h _bbsbuff;buff;60;365;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of the Warrior" action="bypass -h _bbsbuff;buff;60;271;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of Fire" action="bypass -h _bbsbuff;buff;60;274;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of Fury" action="bypass -h _bbsbuff;buff;60;275;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
<button value="Dance of the Vampire" action="bypass -h _bbsbuff;buff;60;310;1; $tvari" width=150 height=18 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<br>
<img src="L2UI.SquareWhite" width=600 height=1>
<br>
<font color=3293F3>Maddev ® 2010-2011 | PvP community board by Снежек ©</font>
</center>
</body>
</html>
вот второй
открыть
PHP код: <?php
<html>
<body>
<center>
<table>
<tr>
<td><button value="Новости" action="bypass -h _bbstop" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Магазин" action="bypass -h _bbstop;30" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Баффер" action="bypass -h _bbstop;60" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Телепорт" action="bypass -h _bbsteleport;" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Карьера" action="bypass -h _bbsclass;" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Сервис" action="bypass -h _bbstop;40" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Крафт" action="bypass -h _bbstop;70" width=90 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=600 height=1>
<table width=600 bgcolor=CCCCCC>
<tr>
<td></td>
<td><a action="bypass -h _bbstop"><font color=F2C202>Главная</font></a></td>
<td><font color=F2C202> -> </font></td>
<td><a action="bypass -h _bbstop;60"><font color=F2C202>Бафферы</font></a></td>
<td width=50></td>
<td align=left><font color=D70000>Группа Бафферов 200000 Адена. 1 Баффер: 20000 Adena</font></td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=600 height=1>
<table width="600" height="20" border="0">
<tr>
<td height="20"><center><button value="Все для война" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuffGroup 1 0 %buffs_in_grp1%" width=100 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
<td><center><button value="Все для мага" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuffGroup 2 0 %buffs_in_grp1%" width=100 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
<td><center><button value="Все танцы" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuffGroup 3 0 %buffs_in_grp1%" width=100 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
<td><center><button value="Все песьни" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuffGroup 4 0 %buffs_in_grp1%" width=100 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center></td>
<td><button value="Все чанты" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuffGroup 5 0 %buffs_in_grp1%" width=100 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><button value="Сброс" action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:cancel_buff_char" width=50 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td><button value="<Назад" action="bypass -h _bbstop;60" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td width=50>Page: 2 </td>
<td><button value="Далее>" action="bypass -h _bbstop;60-2" width=80 height=25 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
</tr>
</table>
<table width="300" height="300" border="0">
<tr>
<td>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0264 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 264 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Earth</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0265 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 265 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Life</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0266 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 266 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Water</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0267 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 267 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Ward</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0268 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 268 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Wind</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0269 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 269 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Hunter</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0270 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 270 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Invocat</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
</td>
<td>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0304 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 304 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Vitality</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0306 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 306 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. F. Guard</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0308 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 308 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. S. Guard</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0349 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 349 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Renewal</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0363 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 363 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Meditat</font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
<table width="135" border="0">
<tr>
<td height=32 width=32 valign=top><img src=icon.skill0364 width=32 height=32></td>
<td height=25><button value=$ action="bypass -h _bbsscripts;60-1;services.PVPCommunityBoard.CBBuffer:doBuff 364 1 0" width=25 height=32 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td height=32><font color=3293F3>S. Champ </font><br1><font color=F2C202>Уровень 1</font></td>
</tr>
</table>
</td>
</tr>
</table>
<img src="L2UI.SquareWhite" width=600 height=1>
<font color=3293F3>Community Board PVP | L2Phoenix © 2010</font>
</center>
</body>
</html>
странички, сражу скажу, еще не доделаны
Вот код BuffBBSManager.java
открыть
PHP код: <?php
package com.l2jserver.gameserver.communitybbs.Manager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.model.*;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.TvTEvent;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
public class BuffBBSManager extends BaseBBSManager
{
private static BuffBBSManager _instance = new BuffBBSManager();
public int allskillid_1[][];
public BuffBBSManager()
{
Load();
}
public static BuffBBSManager getInstance()
{
if(_instance == null)
_instance = new BuffBBSManager();
return _instance;
}
public void Load()
{
Connection connn = null;
try
{
connn = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement count = connn.prepareStatement("SELECT COUNT(*) FROM communitybuff");
ResultSet countt = count.executeQuery();
countt.next();
allskillid_1 = new int[countt.getInt(1)][4];
PreparedStatement table = connn.prepareStatement("SELECT * FROM communitybuff");
ResultSet skills = table.executeQuery();
for(int i = 0; i < allskillid_1.length; i++)
{
skills.next();
allskillid_1[i][0] = skills.getInt(2);
allskillid_1[i][1] = skills.getInt(3);
allskillid_1[i][2] = skills.getInt(4);
allskillid_1[i][3] = skills.getInt(5);
}
count.close();
countt.close();
skills.close();
table.close();
connn.close();
}
catch(Exception ignored) { }
}
@Override
public void parsecmd(String command, L2PcInstance activeChar)
{
String[] parts = command.split("_");
boolean petbuff = false;
if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel())
{
activeChar.sendMessage("В данных условиях бафф запрещен");
return;
}
if (!(parts[2].startsWith("buff")))
return;
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/CommunityBoard/60.htm");
separateAndSend(content, activeChar);
if(parts[4] != null && parts[4].startsWith(" Player"))
petbuff = false;
if(parts[4] != null && parts[4].startsWith(" Pet"))
petbuff = true;
if(parts[3].startsWith("FIGHERLIST"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
FIGHERLIST(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
FIGHERLIST(activeChar, petbuff);
}
if(parts[3].startsWith("DANCEFIGHTERLIST"))
{
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
DANCEFIGHTERLIST(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
DANCEFIGHTERLIST(activeChar, petbuff);
}
}
if(parts[3].startsWith("MAGELIST"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
MAGELIST(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
MAGELIST(activeChar, petbuff);
}
if(parts[3].startsWith("DANCEMAGELIST"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
DANCEMAGELIST(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
DANCEMAGELIST(activeChar, petbuff);
}
if(parts[3].startsWith("SAVE"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
SAVE(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
} else
{
SAVE(activeChar, petbuff);
}
if(parts[3].startsWith("BUFF"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
BUFF(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
} else
{
BUFF(activeChar, petbuff);
}
if(parts[3].startsWith("CANCEL"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
CANCEL(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
CANCEL(activeChar, petbuff);
}
if(parts[3].startsWith("REGMP"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
REGMP(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
REGMP(activeChar, petbuff);
}
if(parts[3].startsWith("REGHP"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
REGHP(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
REGHP(activeChar, petbuff);
}
if(parts[3].startsWith("REGCP"))
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
REGCP(activeChar, petbuff);
else
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
else
{
REGCP(activeChar, petbuff);
}
for(int key = 0; key < allskillid_1.length; key++)
{
L2Skill skill;
int skilllevel;
if(Config.BUFF_PEACE)
{
if(activeChar.isInsideZone((byte)2))
{
skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[key][0]);
skill = SkillTable.getInstance().getInfo(allskillid_1[key][0], skilllevel);
if(parts[3].startsWith(skill.getName()))
SKILL(activeChar, petbuff, key, skill);
} else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, you not town!!", 3000));
}
continue;
}
skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[key][0]);
skill = SkillTable.getInstance().getInfo(allskillid_1[key][0], skilllevel);
if(parts[3].startsWith(skill.getName()))
SKILL(activeChar, petbuff, key, skill);
}
}
private void FIGHERLIST(L2PcInstance activeChar, boolean petbuff)
{
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
if(aSkillid[1] != 1 && aSkillid[1] != 3)
continue;
L2Skill skill;
int skilllevel;
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true))
{
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
continue;
}
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
}
private void DANCEFIGHTERLIST(L2PcInstance activeChar, boolean petbuff)
{
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
if(aSkillid[1] != 4 && aSkillid[1] != 6)
continue;
L2Skill skill;
int skilllevel;
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true))
{
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
continue;
}
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
}
private void MAGELIST(L2PcInstance activeChar, boolean petbuff)
{
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
if(aSkillid[1] != 2 && aSkillid[1] != 3)
continue;
L2Skill skill;
int skilllevel;
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true))
{
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
continue;
}
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
}
private void DANCEMAGELIST(L2PcInstance activeChar, boolean petbuff)
{
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
if(aSkillid[1] != 5 && aSkillid[1] != 6)
continue;
L2Skill skill;
int skilllevel;
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, aSkillid[3], aSkillid[2], activeChar, true))
{
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
continue;
}
skilllevel = SkillTable.getInstance().getMaxLevel(aSkillid[0]);
skill = SkillTable.getInstance().getInfo(aSkillid[0], skilllevel);
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
}
private void BUFF(L2PcInstance activeChar, boolean petbuff)
{
Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT * FROM community_skillsave WHERE charId=?;");
statement.setInt(1, activeChar.getObjectId());
ResultSet rcln = statement.executeQuery();
rcln.next();
if(!petbuff)
{
char allskills[] = rcln.getString(2).toCharArray();
if(allskills.length == allskillid_1.length)
{
for(int i = 0; i < allskillid_1.length; i++)
if(allskills[i] == '1')
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, allskillid_1[i][3], allskillid_1[i][2], activeChar, true))
{
int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[i][0]);
L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[i][0], skilllevel);
skill.getEffects(activeChar, activeChar);
activeChar.getLevel();
} else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
} else
{
int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[i][0]);
L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[i][0], skilllevel);
skill.getEffects(activeChar, activeChar);
}
}
}
else
{
char petskills[] = rcln.getString(3).toCharArray();
if(petskills.length == allskillid_1.length)
{
for(int i = 0; i < allskillid_1.length; i++)
{
if(petskills[i] != '1')
continue;
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, allskillid_1[i][3], allskillid_1[i][2], activeChar, true))
{
int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[i][0]);
L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[i][0], skilllevel);
skill.getEffects(activeChar.getPet(), activeChar.getPet());
} else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
} else
{
int skilllevel = SkillTable.getInstance().getMaxLevel(allskillid_1[i][0]);
L2Skill skill = SkillTable.getInstance().getInfo(allskillid_1[i][0], skilllevel);
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
}
}
}
rcln.close();
statement.close();
}
catch(Exception ignored)
{
try
{
if(con != null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
try
{
if(con != null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
private void CANCEL(L2PcInstance activeChar, boolean petbuff)
{
if(!petbuff)
activeChar.stopAllEffects();
else
activeChar.getPet().stopAllEffects();
}
private void REGMP(L2PcInstance activeChar, boolean petbuff)
{
if(!petbuff)
activeChar.setCurrentMp(activeChar.getMaxMp());
else
activeChar.getPet().setCurrentMp(activeChar.getPet().getMaxMp());
}
private void REGHP(L2PcInstance activeChar, boolean petbuff)
{
if(!petbuff)
activeChar.setCurrentHp(activeChar.getMaxHp());
else
activeChar.getPet().setCurrentHp(activeChar.getPet().getMaxHp());
}
private void REGCP(L2PcInstance activeChar, boolean petbuff)
{
if(!petbuff)
activeChar.setCurrentCp(activeChar.getMaxCp());
else
activeChar.getPet().setCurrentCp(activeChar.getPet().getMaxCp());
}
private void SKILL(L2PcInstance activeChar, boolean petbuff, int key, L2Skill skill)
{
if(Config.MANI_BUFF)
{
if(activeChar.destroyItemByItemId(null, allskillid_1[key][3], allskillid_1[key][2], activeChar, true))
{
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
else
{
activeChar.sendPacket(new ExShowScreenMessage("Sorry, not item!!", 3000));
}
}
else
if(!petbuff)
skill.getEffects(activeChar, activeChar);
else
skill.getEffects(activeChar.getPet(), activeChar.getPet());
}
private void SAVE(L2PcInstance activeChar, boolean petbuff)
{
Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement stat = con.prepareStatement("SELECT COUNT(*) FROM community_skillsave WHERE charId=?;");
stat.setInt(1, activeChar.getObjectId());
ResultSet rset = stat.executeQuery();
rset.next();
String allbuff = "";
if(!petbuff)
{
L2Effect skill[] = activeChar.getAllEffects();
boolean flag = true;
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
for(int j = 0; j < skill.length; j++)
{
if(aSkillid[0] == skill[j].getId())
{
allbuff = (new StringBuilder()).append(allbuff).append(1).toString();
flag = false;
}
if(j == skill.length - 1 && flag)
allbuff = (new StringBuilder()).append(allbuff).append(0).toString();
}
flag = true;
}
if(rset.getInt(1) == 0)
{
PreparedStatement statement1 = con.prepareStatement("INSERT INTO community_skillsave (charId,skills) values (?,?)");
statement1.setInt(1, activeChar.getObjectId());
statement1.setString(2, allbuff);
statement1.execute();
statement1.close();
}
else
{
PreparedStatement statement = con.prepareStatement("UPDATE community_skillsave SET skills=? WHERE charId=?;");
statement.setString(1, allbuff);
statement.setInt(2, activeChar.getObjectId());
statement.execute();
statement.close();
}
}
else
{
L2Effect skill[] = activeChar.getPet().getAllEffects();
boolean flag = true;
int arr$[][] = allskillid_1;
int len$ = arr$.length;
for(int i$ = 0; i$ < len$; i$++)
{
int aSkillid[] = arr$[i$];
for(int j = 0; j < skill.length; j++)
{
if(aSkillid[0] == skill[j].getId())
{
allbuff = (new StringBuilder()).append(allbuff).append(1).toString();
flag = false;
}
if(j == skill.length - 1 && flag)
allbuff = (new StringBuilder()).append(allbuff).append(0).toString();
}
flag = true;
}
if(rset.getInt(1) == 0)
{
PreparedStatement statement1 = con.prepareStatement("INSERT INTO community_skillsave (charId,pet) values (?,?)");
statement1.setInt(1, activeChar.getObjectId());
statement1.setString(2, allbuff);
statement1.execute();
statement1.close();
} else
{
PreparedStatement statement = con.prepareStatement("UPDATE community_skillsave SET pet=? WHERE charId=?;");
statement.setString(1, allbuff);
statement.setInt(2, activeChar.getObjectId());
statement.execute();
statement.close();
}
}
rset.close();
stat.close();
}
catch(Exception ignored)
{
try
{
if(con != null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
try
{
if(con != null)
con.close();
}
catch(SQLException e)
{
e.printStackTrace();
}
}
@Override
public void parsewrite(String s, String s1, String s2, String s3, String s4, L2PcInstance l2pcinstance)
{
}
}
Сообщений: 1,053
Тем: 33
Зарегистрирован: Sep 2011
Репутация:
12,172
07-28-2012, 06:08 PM
(Сообщение последний раз редактировалось: 07-29-2012, 03:50 PM Casper.)
bypass -h _bbsscripts; 60-1;services.PVPCommunityBoard.CBBuffer:doBuff 266 1 0 - это у тебя код со второй страницы.
Первую также перепиши под такие байпасы.
Красным выделено страница на которую перескочить после действия.
Синим выделен id бафа.
Зеленым выделен уровень бафа.
Фиолетовым выдена цена за баф.
PS. Этот баффер кстати багнутый, он работает по методу сохранения баффа с персонажа. Если понял о чём я призадумайся.
Вот аналогичный скрипт только старый с сборки револьт, ток доработанный, переписывали с фени.
Открыть спойлер
МЭго кодыщеPHP код: <?php
package l2rt.gameserver.communitybbs.Manager;
import l2rt.Config;
import l2rt.common.ThreadPoolManager;
import l2rt.config.ConfigSystem;
import l2rt.database.*;
import l2rt.extensions.multilang.CustomMessage;
import l2rt.gameserver.cache.Msg;
import l2rt.gameserver.instancemanager.TownManager;
import l2rt.gameserver.model.*;
import l2rt.gameserver.model.entity.residence.Residence;
import l2rt.gameserver.model.entity.siege.Siege;
import l2rt.gameserver.serverpackets.MagicSkillLaunched;
import l2rt.gameserver.serverpackets.MagicSkillUse;
import l2rt.gameserver.serverpackets.ShowBoard;
import l2rt.gameserver.serverpackets.SystemMessage;
import l2rt.gameserver.skills.Env;
import l2rt.gameserver.model.L2Zone.ZoneType;
import l2rt.gameserver.skills.effects.EffectTemplate;
import l2rt.gameserver.tables.SkillTable;
import l2rt.util.Log;
import java.io.File;
import java.io.FileReader;
import java.io.LineNumberReader;
import java.sql.ResultSet;
import java.util.StringTokenizer;
import java.util.logging.Logger;
public class BuffBBSManager extends BaseBBSManager
{
static final Logger _log = Logger.getLogger(BuffBBSManager.class.getName());
private static BuffBBSManager _Instance = null;
private static int grpCount1;
private static int grpCount2;
private static int grpCount3;
private static int grpCount4;
private static int grpCount5;
private static int[][] buffs = { { 1251, 2, 5 }, { 1252, 3, 5 }, { 1253, 3, 5 }, { 1284, 3, 5 }, { 1308, 3, 5 }, { 1309, 3, 5 }, { 1310, 4, 5 }, { 1362, 1, 5 }, { 1363, 1, 5 }, { 1390, 3, 5 }, { 1391, 3, 5 }, { 264, 1, 4 }, { 265, 1, 4 }, { 266, 1, 4 }, { 267, 1, 4 }, { 268, 1, 4 }, { 269, 1, 4 }, { 270, 1, 4 }, { 304, 1, 4 }, { 305, 1, 4 }, { 306, 1, 4 }, { 308, 1, 4 }, { 349, 1, 4 }, { 363, 1, 4 }, { 364, 1, 4 }, { 271, 1, 3 }, { 272, 1, 3 }, { 273, 1, 3 }, { 274, 1, 3 }, { 275, 1, 3 }, { 276, 1, 3 }, { 277, 1, 3 }, { 307, 1, 3 }, { 309, 1, 3 }, { 310, 1, 3 }, { 311, 1, 3 }, { 365, 1, 3 }, { 7059, 1, 2 }, { 4356, 3, 2 }, { 4355, 3, 2 }, { 4352, 1, 2 }, { 4346, 4, 2 }, { 4351, 6, 2 }, { 4342, 2, 2 }, { 4347, 6, 2 }, { 4348, 6, 2 }, { 4344, 3, 2 }, { 7060, 1, 2 }, { 4350, 4, 2 }, { 7057, 1, 1 }, { 4345, 3, 1 }, { 4344, 3, 1 }, { 4349, 2, 1 }, { 4342, 2, 1 }, { 4347, 6, 1 }, { 4357, 2, 1 }, { 4359, 3, 1 }, { 4358, 3, 1 }, { 4360, 3, 1 }, { 4354, 4, 1 }, { 4346, 4, 1 } };
public static int[] groupbuff = null;
public static BuffBBSManager getInstance()
{
if (_Instance == null)
_Instance = new BuffBBSManager();
return _Instance;
}
BuffBBSManager()
{
Load();
}
public void Load()
{
for (int[] buff : buffs)
switch (buff[2])
{
case 1:
grpCount1 += 1;
break;
case 2:
grpCount2 += 1;
break;
case 3:
grpCount3 += 1;
break;
case 4:
grpCount4 += 1;
break;
case 5:
grpCount5 += 1;
}
}
private boolean confirmBuff(int path, int skill_id, int skill_lvl)
{
LineNumberReader lnr = null;
boolean conf = false;
try
{
File data = new File(ConfigSystem.get("DatapackRoot"), "data/html/CommunityBoardPVP/" + path + ".htm");
lnr = new LineNumberReader(new FileReader(data));
String line;
while ((line = lnr.readLine()) != null)
{
int index = line.indexOf("_bbsbuff");
if (line.startsWith("_bbsbuff;buff;" + path + ";" + skill_id + ";" + skill_lvl + ";", index))
conf = true;
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if(lnr != null)
lnr.close();
}
catch(Exception e1)
{ /* ignore problems */}
}
return conf;
}
public void parsecmd(String command, L2Player player)
{
if (!command.equals("_bbsbuff;"))
{
if (command.startsWith("_bbsbuff;buff;"))
{
StringTokenizer stBuff = new StringTokenizer(command, ";");
stBuff.nextToken();
stBuff.nextToken();
int path = Integer.parseInt(stBuff.nextToken());
int skill_id = Integer.parseInt(stBuff.nextToken());
int skill_lvl = Integer.parseInt(stBuff.nextToken());
String BuffTarget = stBuff.nextToken();
if(confirmBuff(path, skill_id, skill_lvl))
doBuff(skill_id, skill_lvl, BuffTarget, player);
else
Log.IllegalPlayerAction(player, "This player: " + player.getName() + " is cheater, please baned.", 0);
}
else if (command.startsWith("_bbsbuff;grp;"))
{
StringTokenizer stBuffGrp = new StringTokenizer(command, ";");
stBuffGrp.nextToken();
stBuffGrp.nextToken();
int id_groups = Integer.parseInt(stBuffGrp.nextToken());
String BuffTarget = stBuffGrp.nextToken();
doBuffGroup(id_groups, BuffTarget, player);
}
else if (command.equals("_bbsbuff;cancel"))
{
if ((player.getEffectList().getEffectsBySkillId(4515) != null) || (player.getEffectList().getEffectsBySkillId(4215) !=null))
{
player.sendPacket(new SystemMessage(SystemMessage.ONLY_AN_ENHANCED_SKILL_CAN_BE_CANCELLED));
return;
}
else
player.getEffectList().stopAllEffects();
}
else if (command.equals("_bbsbuff;regmp"))
player.setCurrentMp(player.getMaxMp());
else if (command.equals("_bbsbuff;reghp"))
player.setCurrentHp(player.getMaxHp(), true);
else if (command.equals("_bbsbuff;regcp"))
player.setCurrentCp(player.getMaxCp());
else if (command.startsWith("_bbsbuff;save;"))
{
if (!ConfigSystem.getBoolean("restoreBuff"))
{
player.sendMessage(new CustomMessage("l2rt.gameserver.communitybbs.Manager.BuffBBSManager.SaveBuff", player));
return;
}
StringTokenizer stBuffSave = new StringTokenizer(command, ";");
stBuffSave.nextToken();
stBuffSave.nextToken();
int id = Integer.parseInt(stBuffSave.nextToken());
SAVE(player,id);
}
else if (command.startsWith("_bbsbuff;restore;"))
{
if (!ConfigSystem.getBoolean("restoreBuff"))
{
player.sendMessage(new CustomMessage("l2rt.gameserver.communitybbs.Manager.BuffBBSManager.RestorBuff", player));
return;
}
StringTokenizer stBuffRest = new StringTokenizer(command, ";");
stBuffRest.nextToken();
stBuffRest.nextToken();
int ids = Integer.parseInt(stBuffRest.nextToken());
RESTOR(player, ids);
}
else
ShowBoard.separateAndSend("<html><body><br><br><center>В bbsbuff функция: " + command + " пока не реализована</center><br><br></body></html>", player);
}
}
public void doBuff(int skill_id, int skill_lvl, String BuffTarget, L2Player player)
{
L2Summon pet = player.getPet();
if (!checkCondition(player))
return;
if (player.getAdena() < ConfigSystem.getInt("OneBuffPrice"))
{
player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
return;
}
try
{
L2Skill skill = SkillTable.getInstance().getInfo(skill_id, skill_lvl);
if (BuffTarget.startsWith(" Player"))
for (EffectTemplate et : skill.getEffectTemplates())
{
Env env = new Env(player, player, skill);
L2Effect effect = et.getEffect(env);
effect.setPeriod(ConfigSystem.getInt("BuffTime"));
player.getEffectList().addEffect(effect);
}
if (BuffTarget.startsWith(" Pet"))
{
if (pet == null)
return;
for (EffectTemplate et : skill.getEffectTemplates())
{
Env env = new Env(pet, pet, skill);
L2Effect effect = et.getEffect(env);
effect.setPeriod(ConfigSystem.getInt("BuffTime"));
pet.getEffectList().addEffect(effect);
}
}
player.reduceAdena(ConfigSystem.getInt("OneBuffPrice"), true);
}
catch (Exception e)
{
player.sendMessage("Invalid skill!");
}
}
public void doBuffGroup(int id_groups, String BuffTarget, L2Player player)
{
player.sendMessage("id_groups="+id_groups+" BuffTarget="+BuffTarget+" player"+player);
L2Summon pet = player.getPet();
if (!checkCondition(player))
return;
if (player.getAdena() < ConfigSystem.getInt("OneBuffPrice") * ConfigSystem.getInt("GroupBuffPriceModifier"))
{
player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
return;
}
player.reduceAdena((ConfigSystem.getInt("OneBuffPrice") * ConfigSystem.getInt("GroupBuffPriceModifier")), true);
switch (id_groups)
{
case 1:
groupbuff = Config.WARRIOR_BUFF_TEMPLATE;
break;
case 2:
groupbuff = Config.MAGE_BUFF_TEMPLATE;
break;
case 3:
groupbuff = Config.DANCES_BUFF_TEMPLATE;
break;
case 4:
groupbuff = Config.SONGS_BUFF_TEMPLATE;
break;
case 5:
groupbuff = Config.CHANTS_BUFF_TEMPLATE;
}
for(int i = 0; i < groupbuff.length; i += 2)
{
if (BuffTarget.startsWith(" Player"))
{
L2Skill skill = SkillTable.getInstance().getInfo(groupbuff[i], groupbuff[i+1]);
for (EffectTemplate et : skill.getEffectTemplates())
{
Env env = new Env(player, player, skill);
L2Effect effect = et.getEffect(env);
effect.setPeriod(ConfigSystem.getInt("BuffTime"));
player.getEffectList().addEffect(effect);
}
}
if (!BuffTarget.startsWith(" Pet"))
continue;
if (pet == null)
return;
L2Skill skill = SkillTable.getInstance().getInfo(groupbuff[i], groupbuff[i+1]);
for (EffectTemplate et : skill.getEffectTemplates())
{
Env env = new Env(pet, pet, skill);
L2Effect effect = et.getEffect(env);
effect.setPeriod(ConfigSystem.getInt("BuffTime"));
pet.getEffectList().addEffect(effect);
}
}
}
private void SAVE(L2Player player, int id)
{
ThreadConnection con = null;
FiltredPreparedStatement statement = null;
ResultSet rs = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
statement = con.prepareStatement("SELECT COUNT(*) FROM community_skillsave WHERE charId=? AND id=?;");
statement.setInt(1, player.getObjectId());
statement.setInt(2, id);
rs = statement.executeQuery();
rs.next();
String allbuff = "";
L2Effect[] skill = player.getEffectList().getAllFirstEffects();
for (int j = 0; j < skill.length; j++)
allbuff = allbuff + new StringBuilder().append(skill[j].getSkill().getId()).append(";").toString();
if (rs.getInt(1) == 0)
{
statement = con.prepareStatement("INSERT INTO community_skillsave (id,charId,skills) values (?,?,?)");
statement.setInt(1, id);
statement.setInt(2, player.getObjectId());
statement.setString(3, allbuff);
statement.execute();
statement.close();
}
else
{
statement = con.prepareStatement("UPDATE community_skillsave SET skills=? WHERE charId=? AND id=?;");
statement.setString(1, allbuff);
statement.setInt(2, player.getObjectId());
statement.setInt(3, id);
statement.execute();
statement.close();
}
rs.close();
statement.close();
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
DatabaseUtils.closeDatabaseCSR(con, statement, rs);
}
}
private void RESTOR(L2Player player, int id)
{
if (player.isInOlympiadMode())
{
player.sendMessage("Во время Олимпиады нельзя использовать данную функцию.");
return;
}
if (!checkCondition(player))
return;
if (player.getAdena() < ConfigSystem.getInt("OneBuffPrice") * ConfigSystem.getInt("GroupBuffPriceModifier"))
{
player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA);
return;
}
player.reduceAdena((ConfigSystem.getInt("OneBuffPrice") * ConfigSystem.getInt("GroupBuffPriceModifier")), true);
ThreadConnection con = null;
FiltredStatement community_skillsave_statement = null;
FiltredPreparedStatement communitybuff_statement = null;
ResultSet community_skillsave_rs = null; ResultSet communitybuff_rs = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
community_skillsave_statement = con.createStatement();
community_skillsave_rs = community_skillsave_statement.executeQuery("SELECT `charId`, `skills`, `pet` FROM `community_skillsave` WHERE `charId`='" + player.getObjectId() + "' AND `id`='" + id +"'");
if (!community_skillsave_rs.next())
return;
String allskills = community_skillsave_rs.getString(2);
StringTokenizer stBuff = new StringTokenizer(allskills, ";");
while (stBuff.hasMoreTokens())
{
int skilltoresatore = Integer.parseInt(stBuff.nextToken());
int skilllevel = SkillTable.getInstance().getBaseLevel(skilltoresatore);
L2Skill skill = SkillTable.getInstance().getInfo(skilltoresatore, skilllevel);
if (communitybuff_statement == null)
communitybuff_statement = con.prepareStatement("SELECT COUNT(*) FROM `communitybuff` WHERE `skillID`=?");
communitybuff_statement.setInt(1, skilltoresatore);
communitybuff_rs = communitybuff_statement.executeQuery();
if (communitybuff_rs.next())
if (communitybuff_rs.getInt(1) != 0)
for (EffectTemplate et : skill.getEffectTemplates())
{
Env env = new Env(player, player, skill);
L2Effect effect = et.getEffect(env);
effect.setPeriod(ConfigSystem.getInt("BuffTime"));
player.getEffectList().addEffect(effect);
}
else
player.sendMessage("Бафф: " + skill.getName() + " (" + skill.getId() + "), не может быть восстановлен!");
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
DatabaseUtils.closeDatabaseCSR(con, community_skillsave_statement, community_skillsave_rs);
DatabaseUtils.closeDatabaseSR(communitybuff_statement, communitybuff_rs);
}
}
public boolean checkCondition(L2Player player)
{
if (player == null)
return false;
if(player.getReflectionId() != 0 && !ConfigSystem.getBoolean("ALlowCBBufferInInstance"))
{
player.sendMessage("Бафф доступен только в обычном мире.");
return false;
}
if (!ConfigSystem.getBoolean("pvpBoardBuffer"))
{
player.sendMessage("Функция баффа отключена.");
return false;
}
if(!player.isInZone(ZoneType.Town) && Config.BUFFTOWN)
{
player.sendMessage("Функция доступна только в городах.");
return false;
}
if (player.getLevel() > ConfigSystem.getInt("CommBufferMaxLvl") || player.getLevel() < ConfigSystem.getInt("CommBufferMinLvl"))
{
player.sendMessage("Ваш уровень не отвечает требованиям!");
return false;
}
if(!ConfigSystem.getBoolean("AllowCBBufferOnEvent"))
{
if(player.getVar("LastHero_backCoords") != null || player.getVar("TvT_backCoords") != null || player.getVar("CtF_backCoords") != null || player.getVar("Tournament_backCoords") != null)
{
player.sendMessage("Нельзя использовать бафф во время эвентов.");
return false;
}
}
if (!ConfigSystem.getBoolean("AllowCBBufferOnSiege"))
{
Residence castle = TownManager.getInstance().getClosestTown(player).getCastle();
Siege siege = castle.getSiege();
if (siege != null && siege.isInProgress())
{
player.sendMessage("Нельзя использовать бафф во время осады.");
return false;
}
}
return true;
}
public void parsewrite(String ar1, String ar2, String ar3, String ar4, String ar5, L2Player player)
{
}
public class EndPetBuff implements Runnable
{
L2Character _buffer;
L2Skill _skill;
L2Summon _target;
public EndPetBuff(L2Character buffer, L2Skill skill, L2Summon target)
{
_buffer = buffer;
_skill = skill;
_target = target;
}
public void run()
{
_skill.getEffects(_buffer, _target, false, false);
_buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target, _skill.isOffensive()));
}
}
public class BeginPetBuff implements Runnable
{
L2Character _buffer;
L2Skill _skill;
L2Summon _target;
public BeginPetBuff(L2Character buffer, L2Skill skill, L2Summon target)
{
_buffer = buffer;
_skill = skill;
_target = target;
}
public void run()
{
_buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), 0, 0));
ThreadPoolManager.getInstance().scheduleGeneral(new BuffBBSManager.EndPetBuff(_buffer, _skill, _target), 0);
}
}
public class EndBuff implements Runnable
{
L2Character _buffer;
L2Skill _skill;
L2Player _target;
public EndBuff(L2Character buffer, L2Skill skill, L2Player target)
{
_buffer = buffer;
_skill = skill;
_target = target;
}
public void run()
{
_skill.getEffects(_buffer, _target, false, false);
_buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target, _skill.isOffensive()));
}
}
public class BeginBuff implements Runnable
{
L2Character _buffer;
L2Skill _skill;
L2Player _target;
public BeginBuff(L2Character buffer, L2Skill skill, L2Player target)
{
_buffer = buffer;
_skill = skill;
_target = target;
}
public void run()
{
if (_target.isInOlympiadMode())
return;
_buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), 0, 0));
ThreadPoolManager.getInstance().scheduleGeneral(new BuffBBSManager.EndBuff(_buffer, _skill, _target), 0);
}
}
}
Если сможешь переписать по феню, смело в перёд
|