03-08-2011, 11:50 PM
Держите последнее Хтмлки в шаренном хтмл фреи ищите)
Хоть бы как не стремно выглядел расчет награды, цэ с оф скритов
Копирайты не тереть
Хоть бы как не стремно выглядел расчет награды, цэ с оф скритов
Копирайты не тереть
PHP код:
<?php
package com.l2emu.scripts.quests;
import com.l2emu.gameserver.model.actor.L2Npc;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.quest.Quest;
import com.l2emu.gameserver.model.quest.QuestState;
import com.l2emu.gameserver.model.quest.State;
import com.l2emu.gameserver.model.quest.jython.QuestJython;
import com.l2emu.util.Rnd;
//@мейд бай ANZO блеать
//FinalForm Team
/*
1 702 1 a,A Trap for Revenge\0 a,Preparation for Proving\0 a,Soldier Plenos of the Keucereus Alliance Base suggests a mission which can prove one's strength. The mission is to hunt Dius, the Deadman of Destruction, and his subordinate Drakes over the skies of Seed of Destruction. He says one should go and see Soldier Tenis, the injured soldier who's in the center of Keucereus Alliance Base, and ask for advice.\\n\0 0 0 -186177.00000000 242341.00000000 1679.00000000 78 0 0 a,Soldier Tenis\0 0 1 1 32563 -186692.00000000 243539.00000000 2613.00000000 a,No Requirements\0 a,Soldier Plenos of the Keucereus Alliance Base asks to hunt the Variant Drake Wing and his subordinate Drakes which appear over the skies of Seed of Destruction. But he says one cannot catch the Variant Drake Wing with an ordinary method since it is too smart...\0 0 0 0 10273 0 285 1 1 15625 1 0 1 0
1 702 2 a,A Trap for Revenge\0 a,Materials for Preparation\0 a,Soldier Tenis, who got injured when he went out to hunt Dius, says that one cannot see Dius, the Deadman of Destruction, with an ordinary method. He says that one has to use the trap which he developed in order to lure Dius, the Deadman of Destruction. Thus he asks to bring 100 pieces of Drake's Flesh to be used as materials by capturing his subordinate Drak, which appears over the skies of Seed of Destruction.\\n\\nMonsters to be hunted - Drak, Drake Wing, and Mutated Drake Wing\\n\0 1 13877 1 0 -252319.00000000 236044.00000000 5551.00000000 78 0 0 a,Over the Skies of Seed of Destruction\0 1 0 1 32563 -186692.00000000 243539.00000000 2613.00000000 a,No Requirements\0 a,Soldier Plenos of the Keucereus Alliance Base asks to hunt the Variant Drake Wing and his subordinate Drakes which appear over the skies of Seed of Destruction. But he says one cannot catch the Variant Drake Wing with an ordinary method since it is too sma
*/
public final class _702_ATrapforRevenge extends Quest
{
private static final String QN = "702_ATrapforRevenge";
// Квестовые НПЦ
private static final int _plenos = 32563;
private static final int _tenius = 32555;
private static final int _lekon = 32557;
// Мобы
private static final int _drac_1lv = 22612;
private static final int _drac_2lv = 22613;
private static final int _drac_3lv = 25632;
private static final int _drake_wing_knave_1lv = 22610;
private static final int _drake_wing_knave_2lv = 22611;
private static final int _drake_wing_knave_3lv = 25631;
private static final int _mutant_drake_wing = 25626;
// Квестовые итемы
private static final int _drake_flesh = 13877;
private static final int _rotten_blood = 13878;
private static final int _bait = 13879;
private static final int _wings = 13880;
private static final int _red_stone = 14009;
public _702_ATrapforRevenge(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(_plenos);
addTalkId(_plenos);
addTalkId(_tenius);
addTalkId(_lekon);
addKillId(_drac_1lv);
addKillId(_drac_2lv);
addKillId(_drac_3lv);
addKillId(_drake_wing_knave_1lv);
addKillId(_drake_wing_knave_2lv);
addKillId(_drake_wing_knave_3lv);
addKillId(_mutant_drake_wing);
questItemIds = new int[]
{ _drake_flesh, _rotten_blood, _red_stone };
}
@Override
public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
QuestState st = player.getQuestState(QN);
if (st == null)
return event;
if (event.equalsIgnoreCase("32563-02.htm"))
{
st.setState(State.STARTED);
st.set("cond", "1");
st.playSound(SOUND_QUEST_START);
}
else if (event.equalsIgnoreCase("lekon"))
{
if (st.getQuestItemsCount(_rotten_blood) < 1 && st.getQuestItemsCount(_red_stone) < 100)
{
event ="32557-02.htm";
}
else if (st.getQuestItemsCount(_rotten_blood) >= 1 && st.getQuestItemsCount(_red_stone) < 100)
{
event ="32557-03.htm";
}
else if (st.getQuestItemsCount(_rotten_blood) > 1 && st.getQuestItemsCount(_red_stone) >= 100)
{
event ="32557-04.htm";
}
else if (st.getQuestItemsCount(_rotten_blood) >= 1 && st.getQuestItemsCount(_red_stone) >= 100)
{
st.giveItems(_bait,1);
st.takeItems(_rotten_blood,1);
st.takeItems(_red_stone,100);
event ="32557-05.htm";
}
}
else if (event.equalsIgnoreCase("dius_die"))
{
if (st.getQuestItemsCount(_drake_flesh) < 1)
{
event = "32563-05.htm";
}
else if (st.getQuestItemsCount(_drake_flesh) >= 1)
{
event = "32563-06.htm";
}
}
else if (event.equalsIgnoreCase("dius_minions_die"))
{
if (st.getQuestItemsCount(_drake_flesh) < 1)
{
event = "32563-05.htm";
}
else if (st.getQuestItemsCount(_drake_flesh) >= 1)
{
event = "32563-06.htm";
}
}
else if (event.equalsIgnoreCase("dius_minions_reward"))
{
if (st.getQuestItemsCount(_drake_flesh) >= 1)
{
st.rewardItems(57,( st.getQuestItemsCount(13877) * 100 ));
st.takeItems(_drake_flesh,-1);
event = "32563-07.htm";
}
}
else if (event.equalsIgnoreCase("dius_die"))
{
if (st.getQuestItemsCount(_wings) < 1)
{
event = "32563-09.htm";
}
else if (st.getQuestItemsCount(_wings) >= 1)
{
st.rewardItems(57,( st.getQuestItemsCount(_wings) * 200000 ));
st.takeItems(_wings,-1);
event = "32563-10.htm";
}
}
else if (event.equalsIgnoreCase("32563-12.htm"))
{
event = "32563-09.htm";
st.playSound(SOUND_QUEST_DONE);
st.exitQuest(true);
}
else if (event.equalsIgnoreCase("32555-02.htm"))
{
st.set("cond","2");
}
else if (event.equalsIgnoreCase("exit_den"))
{
event = "32555-04.htm";
st.playSound(SOUND_QUEST_DONE);
st.exitQuest(true);
}
else if (event.equalsIgnoreCase("vse_kuski"))
{
if (st.getQuestItemsCount(_drake_flesh) < 100)
{
event = "32555-05.htm";
}
else if (st.getQuestItemsCount(_drake_flesh) >= 100)
{
event = "32555-06.htm";
}
}
else if (event.equalsIgnoreCase("vse_kuski_ex"))
{
if (st.getQuestItemsCount(_drake_flesh) >= 100)
{
st.giveItems(_rotten_blood,1);
st.takeItems(_drake_flesh,100);
event = "32555-07.htm";
}
}
else if (event.equalsIgnoreCase("catch_dios"))
{
if (st.getQuestItemsCount(_wings) < 1)
{
event = "32555-09.htm";
}
else if (st.getQuestItemsCount(_wings) >= 1)
{
event = "32555-10.htm";
}
}
else if (event.equalsIgnoreCase("reward_dios"))
{
int i0 = Rnd.get(1000);
int i1 = Rnd.get(1000);
if( i0 >= 500 && i1 >= 600 )
{
st.rewardItems(57, (Rnd.get(49917) + 125000));
if( i1 < 720 )
{
st.giveItems(9628,( Rnd.get(3) + 1 ));
st.giveItems(9629, (Rnd.get(3) + 1));
}
else if( i1 < 840 )
{
st.giveItems(9629,( Rnd.get(3) + 1 ));
st.giveItems(9630,( Rnd.get(3) + 1 ));
}
else if( i1 < 960 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
st.giveItems(9630,( Rnd.get(3) + 1 ));
}
else if( i1 < 1000 )
{
st.giveItems(9628,( Rnd.get(3) + 1 ));
st.giveItems(9629,( Rnd.get(3) + 1 ));
st.giveItems(9630,( Rnd.get(3) + 1 ));
}
event = "32555-14.htm";
}
else if( i0 >= 500 && i1 < 600 )
{
st.rewardItems(57,( Rnd.get(49917) + 125000 ));
if( i1 < 210 )
{
}
else if( i1 < 340 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
}
else if( i1 < 470 )
{
st.giveItems(9629,( Rnd.get(3) + 1 ));
}
else if( i1 < 600 )
{
st.giveItems(9630, (Rnd.get(3) + 1));
}
event = "32555-15.htm";
}
else if( i0 < 500 && i1 >= 600 )
{
st.rewardItems(57, (Rnd.get(49917) + 25000));
if( i1 < 720 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
st.giveItems(9629,( Rnd.get(3) + 1 ));
}
else if( i1 < 840 )
{
st.giveItems(9629, (Rnd.get(3) + 1));
st.giveItems(9630, (Rnd.get(3) + 1));
}
else if( i1 < 960 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
st.giveItems(9630,( Rnd.get(3) + 1 ));
}
else if( i1 < 1000 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
st.giveItems(9629, (Rnd.get(3) + 1));
st.giveItems(9630, (Rnd.get(3) + 1));
}
event = "32555-16.htm";
}
else if( i0 < 500 && i1 < 600 )
{
st.giveItems(57,( Rnd.get(49917) + 25000 ));
if( i1 < 210 )
{
}
else if( i1 < 340 )
{
st.giveItems(9628, (Rnd.get(3) + 1));
}
else if( i1 < 470 )
{
st.giveItems(9629, (Rnd.get(3) + 1));
}
else if( i1 < 600 )
{
st.giveItems(9630, (Rnd.get(3) + 1));
}
event = "32555-17.htm";
}
st.takeItems(13880, 1);
}
return event;
}
@Override
public final String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = NO_QUEST;
QuestState st = player.getQuestState(QN);
if (st == null)
return htmltext;
if (npc.getNpcId() == _plenos)
{
QuestState first = player.getQuestState("10273_GoodDayToFly");
if (first != null && first.getState() != State.COMPLETED || player.getLevel() < 78)
htmltext = "32563-noql.htm";
else
{
switch (st.getInt("cond"))
{
case 0:
htmltext = "32563-00.htm";
break;
case 1:
htmltext = "32563-03.htm";
break;
case 2:
htmltext = "32563-04.htm";
break;
}
}
}
else if (npc.getNpcId() == _tenius)
{
if (st.getInt("cond") == 1)
{
htmltext = "32555-00.htm";
}
if (st.getInt("cond") == 2)
{
htmltext = "32555-03.htm";
}
}
else if (npc.getNpcId() == _lekon)
{
if (st.getInt("cond") == 2)
{
htmltext = "32557-01.htm";
}
else
{
htmltext ="32557-00.htm";
}
}
return htmltext;
}
@Override
public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{
QuestState st = player.getQuestState(QN);
int npcId = npc.getNpcId();
if (st == null)
return null;
if (st.getInt("cond") == 1)
{
int i0 = Rnd.get(1000);
switch (npcId)
{
case _drac_1lv:
if (i0 < 413)
{
st.giveItems(_drake_flesh,2);
}
else
{
st.giveItems(_drake_flesh,1);
}
st.playSound(SOUND_ITEM_GET);
break;
case _drac_2lv:
if (i0 < 440)
{
st.giveItems(_drake_flesh,2);
}
else
{
st.giveItems(_drake_flesh,1);
}
st.playSound(SOUND_ITEM_GET);
break;
case _drac_3lv:
if (i0 < 991)
{
st.giveItems(_drake_flesh,2);
}
st.playSound(SOUND_ITEM_GET);
break;
case _drake_wing_knave_1lv:
if (i0 < 485)
{
st.giveItems(_drake_flesh,2);
}
else
{
st.giveItems(_drake_flesh,1);
}
st.playSound(SOUND_ITEM_GET);
break;
case _drake_wing_knave_2lv:
{
if (i0 < 451)
{
st.giveItems(_drake_flesh,2);
}
else
{
st.giveItems(_drake_flesh,1);
}
st.playSound(SOUND_ITEM_GET);
break;
}
case _drake_wing_knave_3lv:
{
if (i0 < 485)
{
st.giveItems(_drake_flesh,2);
}
else
{
st.giveItems(_drake_flesh,1);
}
st.playSound(SOUND_ITEM_GET);
break;
}
case _mutant_drake_wing:
if( i0 < 708 )
{
st.giveItems(_wings,(Rnd.get(2) + 1));
}
else if( i0 < 978 )
{
st.giveItems(_wings,(Rnd.get(3) + 3));
}
else if( i0 < 994 )
{
st.giveItems(_wings,(Rnd.get(4) + 6));
}
else if( i0 < 998 )
{
st.giveItems(_wings,(Rnd.get(4) + 10));
}
else if( i0 < 1000 )
{
st.giveItems(_wings,(Rnd.get(5) + 14));
}
st.playSound(SOUND_ITEM_GET);
break;
}
}
return null;
}
public static void main(String[] args)
{
new _702_ATrapforRevenge(702, QN, "A Trap for Revenge");
}
}