Jump to content
  • 0

Npc event manager missing


Question

Posted

Hi!Whanever i run an event like Heavy Medal the mods drops event items but i cant find any Npc manager!Anyone knows how to load the Npc manager for any of this events? My faenor xml file for this event is</Event>

<Event ID="Medals Event" Active="24 Dec 2006-26 Dec 2099">

  <Droplist>

      <AllDrop Items="6392" Count="1,4" Chance="40%" />

  </Droplist>

  <Droplist>

      <AllDrop Items="6393" Count="1,2" Chance="2%" />

  </Droplist>

  <Message Type="OnJoin" Msg="Medals Event: You can collect medals from all mobs and trade them for event rewards!" />

  <EventEnd>

      <Take From="AllPlayers">

          <Item ItemID="6392-6393"></Item>

        </Take>

    </EventEnd>

</Event> 

 

My scripts java file is:

package events.HeavyMedal;

import com.l2jserver.gameserver.instancemanager.QuestManager;
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 Gnacik
**
** Retail Event : 'Heavy Medals'
*/
public class HeavyMedal extends Quest
{
private final static int CAT_ROY = 31228;
private final static int CAT_WINNIE = 31229;
private final static int GLITTERING_MEDAL = 6393;

private final static int WIN_CHANCE = 50;

private final static int[] MEDALS = { 5,10,20,40 };
private final static int[] BADGES = { 6399,6400,6401,6402 };

private static final int[][] _spawns_winnie =
{
  {-44342,-113726,-240,0},
  {-44671,-115437,-240,22500},
  {-13073,122841,-3117,0},
  {-13972,121893,-2988,32768},
  {-14843,123710,-3117,8192},
  {11327,15682,-4584,25000},
  {11243,17712,-4574,57344},
  {18154,145192,-3054,7400},
  {19214,144327,-3097,32768},
  {19459,145775,-3086,48000},
  {17418,170217,-3507,36000},
  {47146,49382,-3059,32000},
  {44157,50827,-3059,57344},
  {79798,55629,-1560,0},
  {83328,55769,-1525,32768},
  {80986,54452,-1525,32768},
  {83329,149095,-3405,49152},
  {82277,148564,-3467,0},
  {81620,148689,-3464,32768},
  {81691,145610,-3467,32768},
  {114719,-178742,-821,0},
  {115708,-182422,-1449,0},
  {-80731,151152,-3043,28672},
  {-84097,150171,-3129,4096},
  {-82678,151666,-3129,49152},
  {117459,76664,-2695,38000},
  {115936,76488,-2711,59000},
  {119576,76940,-2275,40960},
  {-84516,243015,-3730,34000},
  {-86031,243153,-3730,60000},
  {147124,27401,-2192,40960},
  {147985,25664,-2000,16384},
  {111724,221111,-3543,16384},
  {107899,218149,-3675,0},
  {114920,220080,-3632,32768},
  {147924,-58052,-2979,49000},
  {147285,-56461,-2776,33000},
  {44176,-48688,-800,33000},
  {44294,-47642,-792,50000}
};

private static final int[][] _spawns_roy =
{
  {-44337,-113669,-224,0},
  {-44628,-115409,-240,22500},
  {-13073,122801,-3117,0},
  {-13949,121934,-2988,32768},
  {-14786,123686,-3117,8192},
  {11281,15652,-4584,25000},
  {11303,17732,-4574,57344},
  {18178,145149,-3054,7400},
  {19208,144380,-3097,32768},
  {19508,145775,-3086,48000},
  {17396,170259,-3507,36000},
  {47151,49436,-3059,32000},
  {44122,50784,-3059,57344},
  {79806,55570,-1560,0},
  {83328,55824,-1525,32768},
  {80986,54504,-1525,32768},
  {83332,149160,-3405,49152},
  {82277,148598,-3467,0},
  {81621,148725,-3467,32768},
  {81680,145656,-3467,32768},
  {114733,-178691,-821,0},
  {115708,-182362,-1449,0},
  {-80789,151073,-3043,28672},
  {-84049,150176,-3129,4096},
  {-82623,151666,-3129,49152},
  {117498,76630,-2695,38000},
  {115914,76449,-2711,59000},
  {119536,76988,-2275,40960},
  {-84516,242971,-3730,34000},
  {-86003,243205,-3730,60000},
  {147184,27405,-2192,17000},
  {147920,25664,-2000,16384},
  {111776,221104,-3543,16384},
  {107904,218096,-3675,0},
  {114920,220020,-3632,32768},
  {147888,-58048,-2979,49000},
  {147262,-56450,-2776,33000},
  {44176,-48732,-800,33000},
  {44319,-47640,-792,50000}
};

public HeavyMedal(int questId, String name, String descr)
{
  super(questId, name, descr);
  addStartNpc(CAT_ROY);
  addStartNpc(CAT_WINNIE);
  addTalkId(CAT_ROY);
  addTalkId(CAT_WINNIE);
  addFirstTalkId(CAT_ROY);
  addFirstTalkId(CAT_WINNIE);
  for(int[] _spawn : _spawns_roy)
   addSpawn(CAT_ROY, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
  for(int[] _spawn : _spawns_winnie)
   addSpawn(CAT_WINNIE, _spawn[0], _spawn[1], _spawn[2], _spawn[3], false, 0);
}

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
  String htmltext = "";
  QuestState st = player.getQuestState(getName());
  htmltext = event;
  
  int level = checkLevel(st);
  
  if (event.equalsIgnoreCase("game"))
  {
   if (st.getQuestItemsCount(GLITTERING_MEDAL) < MEDALS[level])
    return "31229-no.htm";
   else
    return "31229-game.htm";
  }
  else if (event.equalsIgnoreCase("heads") || event.equalsIgnoreCase("tails"))
  {
   if (st.getQuestItemsCount(GLITTERING_MEDAL) < MEDALS[level])
    return "31229-"+event.toLowerCase()+"-10.htm";
   
   st.takeItems(GLITTERING_MEDAL, MEDALS[level]);
   
   if(Rnd.get(100) > WIN_CHANCE)
   {
    level = 0;
   }
   else
   {
    if (level>0)
     st.takeItems(BADGES[level-1], -1);
    st.giveItems(BADGES[level], 1);
    st.playSound("Itemsound.quest_itemget");
    level++;
   }
   return "31229-"+event.toLowerCase()+"-"+String.valueOf(level)+".htm";
  }
  else if (event.equalsIgnoreCase("talk"))
  {
   return String.valueOf(npc.getNpcId())+ "-lvl-"+String.valueOf(level)+".htm";
  }
  return htmltext;
}

@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
  QuestState st = player.getQuestState(getName());
  if (st == null)
  {
   Quest q = QuestManager.getInstance().getQuest(getName());
   st = q.newQuestState(player);
  }
  return npc.getNpcId()+".htm";
}

public int checkLevel(QuestState st)
{
  int _lev = 0;
  if(st == null)
   return 0;
  else if (st.getQuestItemsCount(6402) > 0)
   _lev = 4;
  else if (st.getQuestItemsCount(6401) > 0)
   _lev = 3;
  else if (st.getQuestItemsCount(6400) > 0)
   _lev = 2;
  else if (st.getQuestItemsCount(6399) > 0)
   _lev = 1;
  
  return _lev;
}

public static void main(String[] args)
{
  new HeavyMedal(-1, "HeavyMedal", "events");
}
}

and finally my script config for the events

 

# Event Engine 

703 mods/eventmodElpies/eventmodElpies.java 

704 mods/eventmodRabbits/eventmodRabbits.java 

705 mods/eventmodRace/eventmodRace.java 

706 

707 # Events 

708 events/CharacterBirthday/CharacterBirthday.java 

709 

710 # Disabled by default events 

711 #events/GiftOfVitality/GiftOfVitality.java 

712 #events/HeavyMedal/HeavyMedal.java 

713 #events/TheValentineEvent/TheValentineEvent.java 

714 #events/FreyaCelebration/FreyaCelebration.java 

715 #events/MasterOfEnchanting/MasterOfEnchanting.java 

 

 

 

 

 

 

 

 

 

 

4 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock