Jump to content
  • 0

dont allow player to summon more than 1 npc at time


Question

Posted

Hi, i have npc buffer which can be summoned with skill. problem is player can summon how many he wants at same time.

how can i fix it? if already summoned one buffer need to disable skill or something to prevent summon second buffer.

2 answers to this question

Recommended Posts

  • 0
Posted

I did not get answer here so I found little trick, maybe there is better ways I don't know.

 

I needed to know if player have already summoned one NPC or not, I needed 1 property from players creature data, I used summoner_id for it because I don't think server will use this property,

player don't have summoner right? so we can store summoned NPCs id temporary there. inside CREATED event i added this:

 

if(myself.sm.master.summoner_id != 0){
            SendScriptEventEx(GetCreatureFromID(myself.sm.master.summoner_id),0,0,-7);
            myself.sm.master.summoner_id = myself.sm.id;
            
        }
        else{
            myself.sm.master.summoner_id = myself.sm.id;
        }

 

 

checking if masters.summoner_id != 0 then it = that summoned NPC id which means player already have one NPC buffer summoned so I decided to unsummon old one and summon new,

 

I get creatureData of old NPC buffer and send script event  with -7, you can send whatever you want:

this part > SendScriptEventEx(GetCreatureFromID(myself.sm.master.summoner_id),0,0,-7);

 

and implemented SCRIPT_EVENT listener in buffer NPC ai

EventHandler SCRIPT_EVENT(script_event_arg1, script_event_arg2, script_event_arg3) {
		if (script_event_arg3 == -7) {
			Despawn();
		}
	}

 

if NPC will receive script event in my case with -7 it will despawn.

 

thats it when player will use skill that summons this NPC, if player already have one summoned old will dissapear and new will be summoned.

 

don't forget to set myself.sm.master.summoner_id = 0;

to 0 again when unsummoning NPC by yourself, to be able summon NPC again...

don't worry if player go offline when player restarts master.summoner_id will be 0 again.

 

 

Admin Lock it.

 

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • I can consider it too, but I would have to port all my own customs to the H5 extender then.
    • I am planning on making adminer optional which would also make php and apache2 optional, I just haven't had time yet. That script I made for myself and I know that I want adminer 😛   " and also be asked about opening 3306 or XXXX and listen to * thanks "   Could you explain this a bit more? I am not sure I should offer the option to open port 3306 as that is a bad thing unless you know what you are doing, and if you know what you are doing it is a simple thing to open it yourself after.   Listen to * is this for login / gameserver or Mariadb?
    • 🎉 ¡Llega EuroLatinL2! 🎉 🌍 Un servidor Interlude x20 con esencia retail y ajustes justos para una experiencia única. 🧠 Desarrollado por profesionales rusos, EuroLatinL2 está basado en el cliente original de Lineage II Interlude. Buscamos revivir lo mejor de la vieja escuela con un balance perfecto entre nostalgia y jugabilidad moderna. 🛡️ ¿Qué hace diferente a EuroLatinL2? ✨ Rates Mid x20 – Equilibrados para un progreso fluido, sin perder el desafío. 🧪 Experiencia 100% retail con leves ajustes para mantener el interés. ⚔️ Raid Bosses épicos ajustados al nivel 80. 💡 Nada de GM Shop, sin buffs OP, sin teleport personalizados. ⛩️ Solo tiendas y contenido original de Lineage II. 🧙 Buffer básico (solo Prophet), duración de 60 minutos. 🔄 Sistema de héroes cada 15 días y Olimpiadas 2h por día. 🛒 Sistema de donaciones solo para servicios estéticos y premium (sin pay-to-win). 🧬 Sistema de skins para armas y armaduras (solo apariencia). 💤 AutoFarm disponible solo con adena/premium, opcional. 🔥 ¿Quieres volver a disfrutar Lineage II como en sus mejores tiempos? 💬 Completa quests, forma grupos reales, derrota jefes con estrategia, y recolecta recetas (¡incluso para Soulshots!). ⏳ ¡La apertura está muy cerca! 🚪 No te quedes fuera de esta aventura. Vive Lineage II como debe ser. 🌐 Sitio oficial: https://eurolatin.eu 📣 ¡Comparte con tu clan y prepárate para la nostalgia! #Lineage2 #Interlude #EuroLatinL2 #L2Classic #PvE #PvP #NostalgiaL2
  • 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