Event AprilFools сборка L2J HF5 не работает. - Форум администраторов игровых серверов
Форум администраторов игровых серверов StormWall - Защита от DDos атак
Регистрация Мнения Справка Сообщество Календарь
Вернуться   Форум администраторов игровых серверов > MMO > Lineage II > Работа со скриптами

Работа со скриптами Помощь в редактировании и написании квестов к Java серверам, а так же эвентов.

Ответ
Опции темы
Непрочитано 16.11.2015, 20:17   #1
Пользователь

Автор темы (Топик Стартер) Event AprilFools сборка L2J HF5 не работает.

Добрый вечер. Нужна помощь с Event AprilFools.
НПС стоит евент загружается без ошибок.
Когда нажимаю поговорить если простой игрок не открывает меню.
Если админом открываются 2 строчки но при нажатии на них нечего не происходит. Может кто увидит ошибку .
AprilFools.java
PHP код:
/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package events.AprilFools;

import com.l2jserver.FunEvents;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.util.Rnd;

/**
 * @author RobíkBobík
 */
public class AprilFools extends Quest
{
    private static final 
int April_Npc 32639;
    private static final 
String start "start.htm";
    private static final 
String good "good.htm";
    private static final 
String bad "bad.htm";
    private static final 
String no_items "no_items.htm";
    private static final 
int APRIL_GIFT 20958;
    
    private static final 
int[] EventMonsters =
    {
        
7000,
        
7001,
        
7002,
        
7003,
        
7004,
        
7005,
        
7006,
        
7007,
        
7008,
        
7009,
        
7010,
        
7011,
        
7012,
        
7013,
        
7014,
        
7015,
        
7016,
        
7017,
        
7018,
        
7019,
        
7020,
        
7021,
        
7022,
        
7023
    
};
    
    @
Override
    
public final String onFirstTalk(L2Npc npcL2PcInstance player)
    {
        
QuestState st player.getQuestState(getName());
        if (
st == null)
        {
            
st newQuestState(player);
        }
        
String htmltext "";
        if (
FunEvents.AP_STARTED)
        {
            
htmltext start;
        }
        else
        {
            
htmltext FunEvents.EVENT_DISABLED;
        }
        return 
htmltext;
    }
    
    @
Override
    
public final String onAdvEvent(String eventL2Npc npcL2PcInstance player)
    {
        
QuestState st player.getQuestState(getName());
        if (
st == null)
        {
            
st newQuestState(player);
        }
        
String htmltext "";
        if (
event.equalsIgnoreCase("play"))
        {
            if (
st.getQuestItemsCount(APRIL_GIFT) >= 100)
            {
                
st.takeItems(APRIL_GIFT100);
                
htmltext giveReward(stplayer);
            }
            else
            {
                
htmltext no_items;
            }
        }
        if (
event.endsWith(".htm"))
        {
            
htmltext event;
        }
        return 
htmltext;
    }
    
    private 
String giveReward(QuestState stL2PcInstance player)
    {
        
String text "";
        
int randomGet Rnd.get(100);
        if (
randomGet <= 50)
        {
            if (
randomGet <= 5)
            {
                if (
Rnd.get(2) == 2)
                {
                    if (
st.getQuestItemsCount(20204) < 1)
                    {
                        
st.giveItems(202041);
                    }
                    else
                    {
                        
st.giveAdena(5000true);
                    }
                }
                else
                {
                    if (
st.getQuestItemsCount(20207) < 1)
                    {
                        
st.giveItems(202071);
                    }
                    else
                    {
                        
st.giveAdena(15000true);
                    }
                }
            }
            else if ((
randomGet 5) && (randomGet <= 32))
            {
                if (
st.getQuestItemsCount(20099) < 1)
                {
                    
st.giveItems(200991);
                }
                else
                {
                    
st.giveAdena(5000true);
                }
            }
            else if ((
randomGet 32) && (randomGet <= 47))
            {
                if (
Rnd.get(2) == 2)
                {
                    if (
st.getQuestItemsCount(14093) < 1)
                    {
                        
st.giveItems(140931);
                    }
                    else
                    {
                        
st.giveAdena(5000true);
                    }
                }
                else
                {
                    if (
st.getQuestItemsCount(14094) < 1)
                    {
                        
st.giveItems(140941);
                    }
                    else
                    {
                        
st.giveAdena(5000true);
                    }
                }
            }
            else
            {
                if (
st.getQuestItemsCount(3434) < 1)
                {
                    
st.giveItems(34341);
                }
                else
                {
                    
st.giveAdena(50000true);
                }
            }
            
text good;
        }
        else
        {
            if ((
randomGet 50) && (randomGet <= 65))
            {
                
player.setKarma(player.getKarma() + 5000);
            }
            else if ((
randomGet 65) && (randomGet <= 68))
            {
                if (
st.getQuestItemsCount(57) < 150000)
                {
                    if (
st.getQuestItemsCount(57) != 0)
                    {
                        
st.takeItems(57st.getQuestItemsCount(57));
                    }
                }
                else
                {
                    
st.takeItems(57150000);
                }
            }
            else if ((
randomGet 68) && (randomGet <= 75))
            {
                
SkillTable.getInstance().getInfo(507615).getEffects(playerplayer);
            }
            else
            {
                
player.setVitalityPoints(0true);
            }
            
text bad;
        }
        return 
text;
    }
    
    @
Override
    
public final String onKill(L2Npc npcL2PcInstance playerboolean isPet)
    {
        
QuestState st player.getQuestState(getName());
        if (
st == null)
        {
            
st newQuestState(player);
        }
        
int npcId npc.getNpcId();
        if (
FunEvents.AP_STARTED)
        {
            for (
int ID EventMonsters)
            {
                if (
npcId == ID)
                {
                    
st.giveItems(APRIL_GIFT1);
                }
            }
        }
        return 
super.onKill(npcplayerisPet);
    }
    
    public 
AprilFools(int questIdString nameString descr)
    {
        
super(questIdnamedescr);
        
        
addStartNpc(April_Npc);
        
addFirstTalkId(April_Npc);
        
addTalkId(April_Npc);
        for (
int MONSTER EventMonsters)
        {
            
addKillId(MONSTER);
        }
    }
    
    public static 
void main(String[] args)
    {
        new 
AprilFools(-1AprilFools.class.getSimpleName(), "events");
        if (
FunEvents.AP_STARTED)
        {
            
_log.warning("Event System: April Fools Day Event loaded ...");
        }
    }



start.htm



PHP код:
<html>
<
body>
Pierre Baguette:<br>
<
br>
Hiadventurer!!<br>
<
br>
I have special game for you. <br>
<
br>
This week you can win or lose somethingI cannot give you information about rewardsbut only info what you need get <font color=FF0000>bad</font> or <font color=00FF00>good</fontrewards .<br>
<
br>
<
a action="bypass -h Quest AprilFoolsDay play">I can play in this gameI'm sure about this.</a><br>
<br>
<a action="bypass -h Quest AprilFoolsDay info.htm">Wait! I don'
t know rules</a><br>
</
body></html
Travesil вне форума Отправить сообщение для Travesil с помощью ICQ Ответить с цитированием
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Падает ява SoniPro Lineage II 13 22.08.2015 00:57
Jython ошибка синтакса(клан квест) GRAFOON Работа со скриптами 13 09.01.2013 16:33
Проблема с баффером GreasyMonste Lineage II 6 03.09.2009 16:17


© 2007–2024 «Форум администраторов игровых серверов»
Защита сайта от DDoS атак — StormWall
Работает на Булке неизвестной версии с переводом от zCarot
Текущее время: 16:47. Часовой пояс GMT +3.

Вверх