Jump to content
  • 0

[HELP] Add Restriction in NPC Buffer


Question

Posted

how do I say that the player in this event and can not use the Buff?

 

I tried without success for some forms... example

 

def onTalk (self,npc,player):

  st = player.getQuestState(qn)

  if st.getPlayer().TVTEvent.isParticipating() :

      return "Warning: You are attending the event TvT and can not use NPC Buffer!"

      st.exitQuest(1) 

 

  elif st.getPlayer()._inEventCTF() :

      return "Warning: You are attending the event CTF and can not use NPC Buffer!"

      st.exitQuest(1) 

 

  else:

      st.setState(STARTED)

      return InitialHtml

 

 

11 answers to this question

Recommended Posts

  • 0
Posted

Que versao do core vc usa? no core que estou codificando qq evento tvt ou ctf q vc cria ele removes todos os efeitos dos char (buffs, etc) ao entrar no evento. portanto isso que vc esta querendo fazer é algo desnecessario. Ele pode se buffar quantas vezes quiser e com qq tipo de buff ao entrar no evento ele irá perder todos.

  • 0
Posted

Quero adicionar esta restrição pro NPC BUFFER nao BUFFAR o cara se ele estiver registrado nos Eventos, eu sei que ele perde os buffs ao inicio do evento, mas tem sempre os safados que tentam de tudo

  • 0
Posted

não adianta ele tentar, o buff sera removido, pode ver q todo server q tem evento ctf e tvt nao se preocupa com isso. Tem um função dentro do core responsavel por essa tarefa, se alguem descobrir algum bug o cara nem vai usar seu npc buffer ele vai criar um char buffer pra entra no evento buffado, isso se ele conseguir. Não sei se no python o objeto do character herda propriedades ou methodos dos eventos nunca testei isso, creio que seja possivel, mas fazer isso com uma proteçao ja existente no core na minha opniao é algo inutil, sem contar q uma codificação pelo core é mais segura que em um script python.

  • 0
Posted

try that and tell me

 

def onEvent(self,event,st):
htmltext = event
if st.getPlayer().isInFunEvent: 
htmltext = "<html><head><body>bla bla bla</body></html>"

  • 0
Posted

fakoykas, I tried as you said and all that without being restricted to event.

 

if st.getPlayer().isInFunEvent:
      return "Warning: You are attending the event TvT and can not use NPC Buffer!"

 

and also tried the following  adding () also unsuccessfully, not restricted anyone! =/

 

if st.getPlayer().isInFunEvent() :
      return "Warning: You are attending the event TvT and can not use NPC Buffer!"

 

sorry for my English I use translator.

  • 0
Posted

do it

 

if st.getplayer()._inEvent()  <<<<

 

try player._inEvent or st.player._inEvent or any object related to players with this function ._inEvent [boolean]

 

I sayid maybe the object 'player' in python dont inherit methods, functions, classes from the classes related to events.

 

I think this code is useless because when the character enter in the tvt zone all effects are removed.

  • 0
Posted

or easier way go to the tvt.java and add a check to the npc dont give buff on event

 

1st you need a private static int npcId = the buffers id;(private or public it doesnt matter here)

 

and than the check is easy

 

if (npcId == the buffers id)

    return false;(or an activeChar.sendMessage or an action failed packet or what you want)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 🏰 Clan Donations System – Power Through Unity This system allows clan members to support their clan directly through donations, turning contribution into strength.   How it works: Every donation made by a clan member is automatically listed in the clan donation panel. Each donation is permanently linked to the clan — no loss, no reset. The Clan Leader manages rewards manually for full transparency.   🎁 Clan Donation Rewards For every donation: The clan receives 5% Real Money or 10% Donate Coins (Leader chooses how the reward is given)   📌 After the reward is delivered, the donation is marked as PAID in the system. 🧾 Full Transparency Player name Donation amount Reward value (Real / Donate Coins) Date & status (Pending / Paid)   Everything is visible. Everything is tracked. Nothing is forgotten.   ⚔️ Support your clan. Strengthen your alliance. Power is built — not given.   https://www.l2dead.com/ https://discord.gg/TGnATuZmdt
    • up  corrected some retail crashes and hooked some new memory adresses that were missing  fix some missing retail behaviors on some recipes , you can also get the server as c4 with fixed scripts fully retail  what has been done to the c4  ( client is already configured) totally fixed npcposes  totally fixed raidbosses and minions bugged quests are fixed (known) a lot of recipes that were wrong  wrong values in several stats and corrected hero weapons behaviors/atk range
    • ποιο ειναι αρχαιο ακριβως? εκανες τον κοπο να ανοιξεις τα λινκς που εστειλα? 
    • Rates: xp45x / sp50x / adena50x (all adena is divided by 100/all shops prices too) Server: Full Official interlude server  with custom modifications Gameplay: l2Gold weapons - jewels, Buffs 1 hour, rebirth, No class change quests, increased movement speed on all classes   Download patch here: https://mega.nz/file/oZdG2KTa#1uTYSyEkNQV9U0Zxj-KLDE88mLj4pzQJZSYs2k3tpzo   Our server is waiting for all Lineage 2 fans who want to relive the good old days. This server is non-profit and fully dedicated to the community. There is no corruption, no pay-to-win, and no hidden agendas—just pure classic L2 fun.
  • 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..