Jump to content

Recommended Posts

Posted
So i share a simply way for niebies...

 

1)Go to your datapack in data/scripts/cron/ directory

2)Create a file and name it tvt.py(py is the extension so if you create a txt file and rename it,remove the txt and add py)

3)Open the file and paste

 

import sys

from com.l2jfree.gameserver.model.entity.events import TvT

TvT.loadData()

TvT.autoEvent()

 

save and close it.

 

4)Finally add in your global tasks the following:

INSERT INTO `global_tasks` (`id`, `task`, `type`, `last_activation`, `param1`, `param2`, `param3`) VALUES

(996, 'jython', 'TYPE_FIXED_SHEDULED', 1206595935732, '60000', '14400000', 'tvt.py');

 

"param1" means time since server restart.So in what i share means that event will start 1 minite after restart

"param2" means how much time that the event will repeat.In what i share event will start automatic every 4 hours

 

You can change it by your needs(for example you may want every 3 hours)

 

Have fun.....

 

how to do this on l2jteon? there is not cron folder!

  • 4 weeks later...
  • 2 weeks later...
  • 2 years later...
Posted

I have problem with add auto eventmodrabbits.java. Can som1 help me with this? Event code :

/*

* This program 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.

*

* This program 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 mods.eventmodRabbits;

 

import java.util.List;

import java.util.concurrent.ScheduledFuture;

 

import javolution.util.FastList;

 

import com.l2jserver.Config;

import com.l2jserver.gameserver.Announcements;

import com.l2jserver.gameserver.ThreadPoolManager;

import com.l2jserver.gameserver.datatables.SkillTable;

import com.l2jserver.gameserver.instancemanager.QuestManager;

import com.l2jserver.gameserver.model.L2Object;

import com.l2jserver.gameserver.model.L2Skill;

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

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

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

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

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

import com.l2jserver.gameserver.model.quest.Event;

import com.l2jserver.gameserver.model.quest.Quest;

import com.l2jserver.gameserver.model.quest.QuestState;

import com.l2jserver.gameserver.util.Util;

import com.l2jserver.util.Rnd;

 

public class eventmodRabbits extends Event

{

// Event NPC's list

private List<L2Npc> _npclist;

// Event Task

ScheduledFuture<?> _eventTask = null;

// Event time

public static final int _event_time = 10;

// Event state

private static boolean _isactive = false;

// Current Chest count

private static int _chest_count = 0;

// How much Chests

private static final int _option_howmuch = 200;

// NPc's

public static final int _npc_snow  = 900101;

public static final int _npc_chest = 900102;

// Skills

public static final int _skill_tornado = 630;

public static final int _skill_magic_eye = 629;

 

// Drop data

private static final int[][] DROPLIST =

{

{  1538,  80,  3, 5 }, // Blessed Scroll of Escape

{  3936,  60,  3, 5 }, // Blessed Scroll of Ressurection

{  14720,  50,  5, 10 }, // E Apiga

{  1540,  40, 20, 30 }, // Quick Healing Potion

{  6622,  35,  1, 3 }, // Giant's Codex

{ 9627,  30,  1, 3 }, // GCM

{ 20004,  25,  1, 1 }, // grejtering

{ 14721,  15,  1, 1 } // GEApiga

};

 

public static void main(String[] args)

{

new eventmodRabbits(-1, "eventmodRabbits", "mods");

}

 

public eventmodRabbits(int questId, String name, String descr)

{

super(questId, name, descr);

 

addStartNpc(_npc_snow);

addFirstTalkId(_npc_snow);

addTalkId(_npc_snow);

 

addFirstTalkId(_npc_chest);

addSkillSeeId(_npc_chest);

addSpawnId(_npc_chest);

addAttackId(_npc_chest);

}

 

@Override

public String onSpawn(L2Npc npc)

{

((L2EventMonsterInstance)npc).eventSetDropOnGround(true);

((L2EventMonsterInstance)npc).eventSetBlockOffensiveSkills(true);

 

npc.setIsImmobilized(true);

npc.disableCoreAI(true);

 

return super.onSpawn(npc);

}

 

@Override

public boolean eventStart()

{

// Don't start event if its active

if(_isactive)

return false;

 

// Check Custom Table - we use custom NPC's

if (!Config.CUSTOM_NPC_TABLE)

return false;

 

// Initialize list

_npclist = new FastList<L2Npc>();

 

// Set Event active

_isactive = true;

 

// Spawn Manager

recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);

 

// Spawn Chests

for(int i=0; i < _option_howmuch; i++)

{

int x = Rnd.get(-60653, -58772);

int y = Rnd.get(-55830, -57718);

recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time*60*1000);

_chest_count++;

}

 

// Announce event start

Announcements.getInstance().announceToAll("Rabbit Event : Chests spawned!");

Announcements.getInstance().announceToAll("Go to Fantasy Isle and grab some rewards!");

Announcements.getInstance().announceToAll("You have "+_event_time+" min - after that time all chests will disappear...");

 

// Schedule Event end

_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()

{

public void run()

{

timeUp();

}

}, _event_time*60*1000);

 

return true;

}

 

private void timeUp()

{

Announcements.getInstance().announceToAll("Time up !");

eventStop();

}

 

@Override

public boolean eventStop()

{

// Don't stop inactive event

if(!_isactive)

return false;

 

// Set inactive

_isactive = false;

 

// Cancel task if any

if (_eventTask != null)

{

_eventTask.cancel(true);

_eventTask = null;

}

// Despawn Npc's

if(!_npclist.isEmpty())

{

for (L2Npc _npc : _npclist)

if (_npc != null)

_npc.deleteMe();

}

_npclist.clear();

 

// Announce event end

Announcements.getInstance().announceToAll("Rabbit Event finished");

 

return true;

}

 

@Override

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

{

String htmltext = event;

 

if (event.equalsIgnoreCase("transform"))

{

if (player.isTransformed() || player.isInStance())

player.untransform();

 

SkillTable.getInstance().getInfo(2428, 1).getEffects(npc, player);

 

return null;

}

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";

}

 

@Override

public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)

{

if (Util.contains(targets,npc))

{

if(skill.getId() == _skill_tornado)

{

dropItem(npc, caster, DROPLIST);

npc.deleteMe();

_chest_count--;

 

if(_chest_count <= 0)

{

Announcements.getInstance().announceToAll("No more chests...");

eventStop();

}

}

else if (skill.getId() == _skill_magic_eye)

{

if(npc instanceof L2EventChestInstance)

((L2EventChestInstance)npc).trigger();

}

}

return super.onSkillSee(npc,caster,skill,targets,isPet);

}

 

@Override

public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill)

{

// Some retards go to event and disturb it by breaking chests

// So... Apply raid curse if player don't use skill on chest but attack it

if(_isactive && npc.getNpcId() == _npc_chest)

SkillTable.getInstance().getInfo(4515, 1).getEffects(npc, attacker);

 

return super.onAttack(npc, attacker, damage, isPet);

}

 

private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)

{

final int chance = Rnd.get(100);

 

for (int i = 0; i < droplist.length; i++)

{

int[] drop = droplist;

if (chance > drop[1])

{

((L2MonsterInstance)mob).dropItem(player, drop[0], Rnd.get(drop[2], drop[3]));

return;

}

}

}

 

private L2Npc recordSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)

{

L2Npc _tmp = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);

if(_tmp != null)

_npclist.add(_tmp);

return _tmp;

}

 

@Override

public boolean eventBypass(L2PcInstance activeChar, String bypass)

{

return false;

}

}

 

Chronicle freya.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
  • Topics

×
×
  • Create New...