Jump to content

Question

Posted (edited)

First of all: if you don't want to help or if u would say: You can get it from me for money... then don't write anything and lock the topic immediately. I want to see if SOMEBODY  ( doesnt have to ) it's his free will, to help me with this....I don't want any drama.....
 
 
 
 
 
I am actually having a problem that i can't solve xD..... i wanna transforom 1 code into another but i am not successing it......it's about kamaels.... i created a npc with quest items for 1st class and 2 nd class, that ppl can buy it and use it.... so they can skip doing class quests ......... when other chars buy it and use it it works fine, but when kamaels do it they can't get the class, because they HAVE TO do the quest, the code requires that from them..... here is the code of the dwarf  and it success taking a item without completed quest ... I want to make some version of code for kamael .....  ( the code is under )
 
 

/*

 * Copyright © 2004-2016 L2J DataPack

 * 

 * This file is part of L2J DataPack.

 * 

 * L2J DataPack 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.

 * 

 * L2J DataPack 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 village_master.DwarfWarehouseChange1;

 

import ai.npc.AbstractNpcAI;

 

import com.l2jserver.gameserver.enums.CategoryType;

import com.l2jserver.gameserver.model.actor.L2Npc;

import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

import com.l2jserver.gameserver.model.base.ClassId;

 

/**

 * Dwarf class transfer AI.

 * @author Adry_85

 */

public final class DwarfWarehouseChange1 extends AbstractNpcAI

{

// NPCs

private static int[] NPCS =

{

30498, // Moke

30503, // Rikadio

30594, // Ranspo

32092, // Alder

};

 

// Items

private static final int SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE = 8869;

private static final int RING_OF_RAVEN = 1642;

// Class

private static final int SCAVENGER = 54;

 

private DwarfWarehouseChange1()

{

super(DwarfWarehouseChange1.class.getSimpleName(), "village_master");

addStartNpc(NPCS);

addTalkId(NPCS);

}

 

@Override

public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)

{

String htmltext = null;

switch (event)

{

case "30498-01.htm": // warehouse_chief_moke003f

case "30498-02.htm": // warehouse_chief_moke006fa

case "30498-03.htm": // warehouse_chief_moke007fa

case "30498-04.htm": // warehouse_chief_moke006fb

case "30503-01.htm": // warehouse_chief_rikadio003f

case "30503-02.htm": // warehouse_chief_rikadio006fa

case "30503-03.htm": // warehouse_chief_rikadio007fa

case "30503-04.htm": // warehouse_chief_rikadio006fb

case "30594-01.htm": // warehouse_chief_ranspo003f

case "30594-02.htm": // warehouse_chief_ranspo006fa

case "30594-03.htm": // warehouse_chief_ranspo007fa

case "30594-04.htm": // warehouse_chief_ranspo006fb

case "32092-01.htm": // warehouse_chief_older003f

case "32092-02.htm": // warehouse_chief_older006fa

case "32092-03.htm": // warehouse_chief_older007fa

case "32092-04.htm": // warehouse_chief_older006fb

{

htmltext = event;

break;

}

case "54":

{

htmltext = ClassChangeRequested(player, npc, Integer.valueOf(event));

break;

}

}

return htmltext;

}

 

private String ClassChangeRequested(L2PcInstance player, L2Npc npc, int classId)

{

String htmltext = null;

if (player.isInCategory(CategoryType.SECOND_CLASS_GROUP))

{

htmltext = npc.getId() + "-06.htm"; // fnYouAreSecondClass

}

else if (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))

{

htmltext = npc.getId() + "-07.htm"; // fnYouAreThirdClass

}

else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))

{

htmltext = "30498-12.htm"; // fnYouAreFourthClass

}

else if ((classId == SCAVENGER) && (player.getClassId() == ClassId.dwarvenFighter))

{

if (player.getLevel() < 20)

{

if (hasQuestItems(player, RING_OF_RAVEN))

{

htmltext = npc.getId() + "-08.htm"; // fnLowLevel11

}

else

{

htmltext = npc.getId() + "-09.htm"; // fnLowLevelNoProof11

}

}

else if (hasQuestItems(player, RING_OF_RAVEN))

{

takeItems(player, RING_OF_RAVEN, -1);

player.setClassId(SCAVENGER);

player.setBaseClass(SCAVENGER);

// SystemMessage and cast skill is done by setClassId

player.broadcastUserInfo();

giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);

htmltext = npc.getId() + "-10.htm"; // fnAfterClassChange11

}

else

{

htmltext = npc.getId() + "-11.htm"; // fnNoProof11

}

}

return htmltext;

}

 

@Override

public String onTalk(L2Npc npc, L2PcInstance player)

{

String htmltext = null;

if (player.isInCategory(CategoryType.BOUNTY_HUNTER_GROUP))

{

htmltext = npc.getId() + "-01.htm"; // fnClassList1

}

else

{

htmltext = npc.getId() + "-05.htm"; // fnClassMismatch

}

return htmltext;

}

 

public static void main(String[] args)

{

new DwarfWarehouseChange1();

}

}

 
 
 
_____________________________________________________________________________________________________________________________________________________
 
 
and then here is the Kamael code that doesn't work, I  wanna make it that it doesn't require to take make the quest..... i want to make it ifplayerhasitems to take them and give him the class by it's id.....not that he ' has to do ' the quest.....  :( .... heres the code of stupid kamael....
 
 
 
 

/*
 * Copyright © 2004-2016 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack 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.
 * 
 * L2J DataPack 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 village_master.KamaelChange1;
 
import quests.Q00062_PathOfTheTrooper.Q00062_PathOfTheTrooper;
import quests.Q00063_PathOfTheWarder.Q00063_PathOfTheWarder;
import ai.npc.AbstractNpcAI;
 
import com.l2jserver.gameserver.data.xml.impl.CategoryData;
import com.l2jserver.gameserver.enums.CategoryType;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.base.ClassId;
import com.l2jserver.gameserver.model.quest.QuestState;
 
/**
 * Kamael class transfer AI.
 * @author Adry_85
 */
public final class KamaelChange1 extends AbstractNpcAI
{
// NPCs
private static int[] NPCS =
{
32191, // Hanarin
32193, // Yeniche
32196, // Gershwin
32199, // Holst
32202, // Khadava
};
 
// Items
private static final int SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE = 8869;
private static final int GWAINS_RECOMMENDATION = 9753;
private static final int STEELRAZOR_EVALUATION = 9772;
 
private KamaelChange1()
{
super(KamaelChange1.class.getSimpleName(), "village_master");
addStartNpc(NPCS);
addTalkId(NPCS);
}
 
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "32191-02.htm": // master_all_kamael003m
case "32191-03.htm": // master_all_kamael006ma
case "32191-04.htm": // master_all_kamael007ma
case "32191-05.htm": // master_all_kamael007mait
case "32191-06.htm": // master_all_kamael003f
case "32191-07.htm": // master_all_kamael006fa
case "32191-08.htm": // master_all_kamael007fa
case "32191-09.htm": // master_all_kamael007fa
{
htmltext = event;
break;
}
case "125":
case "126":
{
htmltext = ClassChangeRequested(player, Integer.valueOf(event));
break;
}
}
return htmltext;
}
 
private String ClassChangeRequested(L2PcInstance player, int classId)
{
String htmltext = null;
if (CategoryData.getInstance().isInCategory(CategoryType.KAMAEL_SECOND_CLASS_GROUP, classId))
{
if (player.isInCategory(CategoryType.KAMAEL_SECOND_CLASS_GROUP))
{
htmltext = "32191-10.htm"; // master_all_kamael004a
}
else if (player.isInCategory(CategoryType.KAMAEL_THIRD_CLASS_GROUP))
{
htmltext = "32191-11.htm"; // master_all_kamael005a
}
else if (player.isInCategory(CategoryType.KAMAEL_FOURTH_CLASS_GROUP))
{
htmltext = "32191-12.htm"; // master_all_kamael100a
}
else if ((classId == 125) && (player.getClassId() == ClassId.maleSoldier))
{
QuestState qs = player.getQuestState(Q00062_PathOfTheTrooper.class.getSimpleName());
if (player.getLevel() < 20)
{
if ((qs != null) && qs.isCompleted())
{
htmltext = "32191-13.htm"; // master_all_kamael009ma
}
else
{
htmltext = "32191-14.htm"; // master_all_kamael008ma
}
}
else if ((qs == null) || !qs.isCompleted())
{
htmltext = "32191-15.htm"; // master_all_kamael010ma
}
else
{
takeItems(player, GWAINS_RECOMMENDATION, -1);
player.setClassId(125);
player.setBaseClass(125);
// SystemMessage and cast skill is done by setClassId
player.broadcastUserInfo();
giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);
htmltext = "32191-16.htm"; // master_all_kamael011ma
}
}
else if ((classId == 126) && (player.getClassId() == ClassId.femaleSoldier))
{
QuestState qs = player.getQuestState(Q00063_PathOfTheWarder.class.getSimpleName());
if (player.getLevel() < 20)
{
if ((qs != null) && qs.isCompleted())
{
htmltext = "32191-17.htm"; // master_all_kamael008fa
}
else
{
htmltext = "32191-18.htm"; // master_all_kamael009fa
}
}
else if ((qs == null) || !qs.isCompleted())
{
htmltext = "32191-19.htm"; // master_all_kamael010fa
}
else
{
takeItems(player, STEELRAZOR_EVALUATION, -1);
player.setClassId(126);
player.setBaseClass(126);
// SystemMessage and cast skill is done by setClassId
player.broadcastUserInfo();
giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);
htmltext = "32191-20.htm"; // master_all_kamael011fa
}
}
}
return htmltext;
}
 
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = null;
if (player.getRace() != Race.KAMAEL)
{
htmltext = "32191-01.htm"; // master_all_kamael002a
}
else if (player.isInCategory(CategoryType.KAMAEL_FIRST_CLASS_GROUP))
{
if (player.getClassId() == ClassId.maleSoldier)
{
htmltext = "32191-02.htm"; // master_all_kamael003m
}
else if (player.getClassId() == ClassId.femaleSoldier)
{
htmltext = "32191-06.htm"; // master_all_kamael003f
}
}
else if (player.isInCategory(CategoryType.KAMAEL_SECOND_CLASS_GROUP))
{
htmltext = "32191-10.htm"; // master_all_kamael004a
}
else if (player.isInCategory(CategoryType.KAMAEL_THIRD_CLASS_GROUP))
{
htmltext = "32191-11.htm"; // master_all_kamael005a
}
else
{
htmltext = "32191-12.htm"; // master_all_kamael100a
}
return htmltext;
}
 
public static void main(String[] args)
{
new KamaelChange1();
}
}

 

 
 
 
 
 
Thanks in advance. Keep in mind i don't want any drama....
 If you want to help then help, if you don't want to help, ignore or lock the topic/delete... whatever..... thanks........
 
 
P.S. I am sorry, i am just tired of this kind of comments.... why to make it when you can simply avoid it.... 

 

Edited by Celestine

5 answers to this question

Recommended Posts

  • 0
Posted

Wrong section.. You should post it here. I will ask for move.

 

Edit your topic and add

 (without space) or use pastebin.com for your code to be more readable... 

 

 

  • 0
Posted

Wrong section.. You should post it here. I will ask for move.

 

Edit your topic and add

 (without space) or use pastebin.com for your code to be more readable... 

 

Done + edited the topic.

  • 0
Posted
		else if ((classId == 125) && (player.getClassId() == ClassId.maleSoldier))
		{
-			QuestState qs = player.getQuestState(Q00062_PathOfTheTrooper.class.getSimpleName());
-			if (player.getLevel() < 20)
-			{
-				if ((qs != null) && qs.isCompleted())
-				{
-					htmltext = "32191-13.htm"; // master_all_kamael009ma
-				}
-				else
-				{
-					htmltext = "32191-14.htm"; // master_all_kamael008ma
-				}
-			}
-			else if ((qs == null) || !qs.isCompleted())
-			{
-				htmltext = "32191-15.htm"; // master_all_kamael010ma
-			}
-			else
-			{
				takeItems(player, GWAINS_RECOMMENDATION, -1);
				player.setClassId(125);
				player.setBaseClass(125);
				// SystemMessage and cast skill is done by setClassId
				player.broadcastUserInfo();
				giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);
				htmltext = "32191-16.htm"; // master_all_kamael011ma
-			}
		}
		else if ((classId == 126) && (player.getClassId() == ClassId.femaleSoldier))
		{
-			QuestState qs = player.getQuestState(Q00063_PathOfTheWarder.class.getSimpleName());
-			if (player.getLevel() < 20)
-			{
-				if ((qs != null) && qs.isCompleted())
-				{
-					htmltext = "32191-17.htm"; // master_all_kamael008fa
-				}
-				else
-				{
-				htmltext = "32191-18.htm"; // master_all_kamael009fa
-				}
-			}
-			else if ((qs == null) || !qs.isCompleted())
-			{
-				htmltext = "32191-19.htm"; // master_all_kamael010fa
-			}
-			else
-			{
				takeItems(player, STEELRAZOR_EVALUATION, -1);
				player.setClassId(126);
				player.setBaseClass(126);
				// SystemMessage and cast skill is done by setClassId
				player.broadcastUserInfo();
				giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);
				htmltext = "32191-20.htm"; // master_all_kamael011fa
-			}
		}

try this one

  • 0
Posted (edited)

can i use  if ((qs != null) && qs.isCompleted]())  and then  takeItems(player, STEELRAZOR_EVALUATION -1);

                player.setClassId(126);

               player.setBaseClass(126);

                // SystemMessage and cast skill is done by setClassId

               player.broadcastUserInfo();

                giveItems(player, SHADOW_ITEM_EXCHANGE_COUPON_D_GRADE, 15);

            }

        }

Edited by milosvamp
Guest
This topic is now closed to further replies.


  • Posts

    • p0w3rf1y was Nikita? also how do these things work, they take a base lets say acis or lucera version XXX and then they build up from that to whatever they have today themselves without further company from..again, lucera or acis for example?
    • - CHAPTER IV NEW START FROM 16.MAY.2026 - RATES Experience (EXP) 30x Skill Points (SP) 30x Adena 10x Drop for Spoil 10x General Drop 10x RaidBoss Drop 3x Manor 4x Quest Drop 2x Quest Reward 3x Fishing Drop 10x Vitality System 25x Clan Reputation Point 2x ENCHANTS Safe Enchant +3 Max. Enchant +16 Normal Scroll chance 70% Blessed Scroll chance 80% Max donation enchant is +8 Yogi event enchant rate is 35% -Olf Max Enchant +9 enchant rates: +1 to +3 100%, +4 65%, +5 65%, +6 60%, +7 60%, +8 50%, +9 45% Elemental Max. Level Level 7 Elemental Stone chance 55% Elemental Crystal chance 50% CONFIGURATION Buffs, Dances, Songs Duration 2 hours Buff Slots 28+4+12 Max. Clients per PC 2 / IP 4 Olympiads Max. Enchant +8 Premium Geodata and Pathnodes Sub-Class Max. Level 85 Offline Shop mode Auto Learn Skills Vitality System Champions System Wedding System Class Master AUTO EVENTS Team vs. Team Last Man Standing Treasure Hunt Korean Style Capture the Flag Lucky Creatures Protect the King Russian Roulette Fight For Throne Deathmatch Domination TvT VIP Advanced Zombies Treasure Hunt No-PvP Hunting Grounds Mass Domination Lucky Chests Mutant Battlefields Mini Events Rabbits Simon Says Summer Meleons Pirates Treasure Hitman - Bounty Hunters Medal Collector Boss Random Etc. RAIDS RESPAWN TIME Valakas 72 hours / 24 hours random spawn Antharas 72 hours / 8 hours random spawn Baium 48 hours / 2 hours random spawn Baylor 24 hours/ 12 hours random spawn Beleth 48 hour OTHER Special Goddess of Destruction and Heroic Cloaks Goddess of Destruction .dress me Armors PvP + Rank + RPC Reward system Daily Quests available in community board New Achievements system Tournament system 1vs1 + Daily Tournament Academy Search for newbies, with payment Party Matching with class filter and manage Register to Fortress Siege as single player Cancelled buffs will return in 60 seconds (disabled) Improved .acpon will use now: MP, CP, GCP, GHP. SOULS Maximum number of slots for Private Store is 50 The maximum level for subclass is up to level 85 Multiple commands with advanced options, see them in com board You can view a monster drop rate and list by using shift+click Olympiad - Heroes are formed every Saturday at 01:05 GMT+2 Advanced Community Board with lots of new features for perfect play Advanced NPC buffer with almost all skills and up to 4 schemes per character Special Quiz event every 5 hours with over 500 questions and good reward Custom special Raids with special drop, with A.I against bots All major raids drop Donation Coins and Divine S Scrolls Super T.Rex with better drop and starting premium pets Glittering Medals from all mobs to exchange for special items Reduced number of clan members to raise the clan level and less reputation required Clan / Alliance has a reduced penalty AutoFarm, Community Cleaner, Weapon Repair system, Player Info, Server Online Statistics And many more... http://l2viserion.com https://www.facebook.com/l2viserion
    • - CHAPTER IV NEW START FROM 16.MAY.2026 - RATES Experience (EXP) 30x Skill Points (SP) 30x Adena 10x Drop for Spoil 10x General Drop 10x RaidBoss Drop 3x Manor 4x Quest Drop 2x Quest Reward 3x Fishing Drop 10x Vitality System 25x Clan Reputation Point 2x ENCHANTS Safe Enchant +3 Max. Enchant +16 Normal Scroll chance 70% Blessed Scroll chance 80% Max donation enchant is +8 Yogi event enchant rate is 35% -Olf Max Enchant +9 enchant rates: +1 to +3 100%, +4 65%, +5 65%, +6 60%, +7 60%, +8 50%, +9 45% Elemental Max. Level Level 7 Elemental Stone chance 55% Elemental Crystal chance 50% CONFIGURATION Buffs, Dances, Songs Duration 2 hours Buff Slots 28+4+12 Max. Clients per PC 2 / IP 4 Olympiads Max. Enchant +8 Premium Geodata and Pathnodes Sub-Class Max. Level 85 Offline Shop mode Auto Learn Skills Vitality System Champions System Wedding System Class Master AUTO EVENTS Team vs. Team Last Man Standing Treasure Hunt Korean Style Capture the Flag Lucky Creatures Protect the King Russian Roulette Fight For Throne Deathmatch Domination TvT VIP Advanced Zombies Treasure Hunt No-PvP Hunting Grounds Mass Domination Lucky Chests Mutant Battlefields Mini Events Rabbits Simon Says Summer Meleons Pirates Treasure Hitman - Bounty Hunters Medal Collector Boss Random Etc. RAIDS RESPAWN TIME Valakas 72 hours / 24 hours random spawn Antharas 72 hours / 8 hours random spawn Baium 48 hours / 2 hours random spawn Baylor 24 hours/ 12 hours random spawn Beleth 48 hour OTHER Special Goddess of Destruction and Heroic Cloaks Goddess of Destruction .dress me Armors PvP + Rank + RPC Reward system Daily Quests available in community board New Achievements system Tournament system 1vs1 + Daily Tournament Academy Search for newbies, with payment Party Matching with class filter and manage Register to Fortress Siege as single player Cancelled buffs will return in 60 seconds (disabled) Improved .acpon will use now: MP, CP, GCP, GHP. SOULS Maximum number of slots for Private Store is 50 The maximum level for subclass is up to level 85 Multiple commands with advanced options, see them in com board You can view a monster drop rate and list by using shift+click Olympiad - Heroes are formed every Saturday at 01:05 GMT+2 Advanced Community Board with lots of new features for perfect play Advanced NPC buffer with almost all skills and up to 4 schemes per character Special Quiz event every 5 hours with over 500 questions and good reward Custom special Raids with special drop, with A.I against bots All major raids drop Donation Coins and Divine S Scrolls Super T.Rex with better drop and starting premium pets Glittering Medals from all mobs to exchange for special items Reduced number of clan members to raise the clan level and less reputation required Clan / Alliance has a reduced penalty AutoFarm, Community Cleaner, Weapon Repair system, Player Info, Server Online Statistics And many more... http://l2viserion.com https://www.facebook.com/l2viserion
    • TG Support: Buying Proxy | Channel: Buying Proxy Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server! Create your account for free here
    • It’s been a while since this situation started. As I’ve mentioned before, you are no longer kids you’re grown adults. Please resolve your disagreements through DMs, not forum threads.   I understand that you are competitors, but the rest of the community isn’t interested in your disputes. Stop publicly accusing each other and focus on handling issues privately.   The reputation system is not to be abused. Hearing complaints like “he downvoted me” every day is not productive. This thread will remain locked. Please grow up and handle your problems through private messages.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..