Você não é registrado, por favor registre-se para ter acesso ao conteúdo completo.
Caso seja registrado, efetue login.
Esqueceu sua senha? Clique aqui
Recomendamos o uso do Mozilla Firefox para uma melhor visualização.
mais esse que vs me passou ele da spwn no 29020 e eu to tentando por o npc para dar spwn no 40020, (duplicado, ja testado);
Quando mudo a linha
"private static final int LIVE_BAIUM = 29020;"
deixo asssim "private static final int LIVE_BAIUM = 40020;"
Ele aparece uma mensagem de erro quando clico no weke a baium.
----------
seto, tentei por teu java do baium e agora nem carregou o gamesever, deu erro no baium enquanto carregava.
vou postar aqui meu js do baium pra verem ok?
Citação:
/*
* 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 ai.individual;
/**
* Baium AI
*
* Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but
* players also lose their ability to wake baium up. However, should another person
* enter the room and wake him up, the players who had stayed inside may join the raid.
* This can be helpful for players who became victims of a reboot (they only need 1 new player to
* enter and wake up baium) and is not too exploitable since any player wishing to exploit it
* would have to suffer 5 days of being parked in an empty room.
* Note2: Neither version of Baium should be a permanent spawn. This script is fully capable of
* spawning the statue-version when the lock expires and switching it to the mob version promptly.
*
* Additional notes ( source [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
):
* * Baium only first respawns five days after his last death. And from those five days he will
* respawn within 1-8 hours of his last death. So, you have to know his last time of death.
* * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in
* [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium
* will automatically kill whoever wakes him. There are some people that have been able to
* wake him and not die, however if you've already gone through the trouble of getting the
* bloody fabric and camped him out and researched his spawn time, are you willing to take that
* chance that you'll wake him and not be able to finish your quest? Doubtful.
* [ this powerful attack vs the player who wakes him up is NOT yet implemented here]
* * once someone starts attacking Baium no one else can port into the chamber where he is.
* Unlike with the other raid bosses, you can just show up at any time as long as you are there
* when they die. Not true with Baium. Once he gets attacked, the port to Baium closes. byebye,
* see you in 5 days. If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the
* vortex
*
* @author Fulminus version 0.1
*/
public class Baium extends L2AttackableAIScript
{
private L2Character _target;
private L2Skill _skill;
private static final int STONE_BAIUM = 29025;
private static final int ANGELIC_VORTEX = 31862;
private static final int LIVE_BAIUM = 29020;
private static final int STONE_LOC[] = { 116033,17447,10104,40188 };
private static final int ARCHANGEL = 29021;
private static FastList<L2Attackable> _Minions = new FastList<L2Attackable>();
private final static int ANGEL_LOCATION[][] = { // fixed archangel spawnloc
{ 113004, 16209, 10076, 60242 }, { 114053, 16642, 10076, 4411 },
{ 114563, 17184, 10076, 49241 }, { 116356, 16402, 10076, 31109 },
{ 115015, 16393, 10076, 32760 }, { 115481, 15335, 10076, 16241 },
{ 114680, 15407, 10051, 32485 }, { 114886, 14437, 10076, 16868 },
{ 115391, 17593, 10076, 55346 }, { 115245, 17558, 10076, 35536 } };
//Baium status tracking
private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked
private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked.
private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked
private static long _LastAttackVsBaiumTime = 0;
private static L2BossZone _Zone;
// Quest NPC starter initialization
addStartNpc(STONE_BAIUM);
addStartNpc(ANGELIC_VORTEX);
addTalkId(STONE_BAIUM);
addTalkId(ANGELIC_VORTEX);
_Zone = GrandBossManager.getInstance().getZone(113100,1450 0,10077);
StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BA IUM);
int status = GrandBossManager.getInstance().getBossStatus(LIVE_ BAIUM);
if (status == DEAD)
{
// load the unlock date and time for baium from DB
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
if (temp > 0)
{
// the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer
// to fire at the correct time (calculate the time between now and the unlock time,
// setup a timer to fire after that many msec)
startQuestTimer("baium_unlock", temp, null, null);
}
else
{
// the time has already expired while the server was offline. Delete the saved time and
// immediately spawn the stone-baium. Also the state need not be changed from ASLEEP
addSpawn(STONE_BAIUM,STONE_LOC[0],STONE_LOC[1],STONE_LOC[2],STONE_LOC[3],false,0);
GrandBossManager.getInstance().setBossStatus(LIVE_ BAIUM,ASLEEP);
}
}
else if (status == AWAKE)
{
int loc_x = info.getInteger("loc_x");
int loc_y = info.getInteger("loc_y");
int loc_z = info.getInteger("loc_z");
int heading = info.getInteger("heading");
final int hp = info.getInteger("currentHP");
final int mp = info.getInteger("currentMP");
L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM,loc_x,loc_y,loc_z,heading,fals e,0);
GrandBossManager.getInstance().addBoss(baium);
final L2Npc _baium = baium;
ThreadPoolManager.getInstance().scheduleGeneral(ne w Runnable() {
public void run()
{
try
{
_baium.setCurrentHpMp(hp,mp);
_baium.setIsInvul(true);
_baium.setIsImmobilized(true);
_baium.setRunning();
_baium.broadcastPacket(new SocialAction(_baium.getObjectId(),2));
startQuestTimer("baium_wakeup",15000, _baium, null);
}
catch (Exception e)
{
e.printStackTrace();
}
}
},100L);
}
else
addSpawn(STONE_BAIUM,STONE_LOC[0],STONE_LOC[1],STONE_LOC[2],STONE_LOC[3],false,0);
}
for(int i = 0; i < 5; i++)
_Minions.add((L2Attackable) addSpawn(ARCHANGEL,ANGEL_LOCATION[i][0],ANGEL_LOCATION[i][1],ANGEL_LOCATION[i][2],ANGEL_LOCATION[i][3],false,0));
// TODO: the person who woke baium up should be knocked across the room, onto a wall, and
// lose massive amounts of HP.
}
// despawn the live baium after 30 minutes of inactivity
// also check if the players are cheating, having pulled Baium outside his zone...
}
else if (event.equalsIgnoreCase("baium_despawn") && npc != null)
{
if (npc.getNpcId() == LIVE_BAIUM)
{
// just in case the zone reference has been lost (somehow...), restore the reference
if (_Zone == null)
_Zone = GrandBossManager.getInstance().getZone(113100,1450 0,10077);
if (_LastAttackVsBaiumTime + 1800000 < System.currentTimeMillis())
{
npc.deleteMe(); // despawn the live-baium
addSpawn(STONE_BAIUM,STONE_LOC[0],STONE_LOC[1],STONE_LOC[2],STONE_LOC[3],false,0); // spawn stone-baium
GrandBossManager.getInstance().setBossStatus(LIVE_ BAIUM,ASLEEP); // mark that Baium is not awake any more
_Zone.oustAllPlayers();
cancelQuestTimer("baium_despawn", npc, null);
for (L2Attackable minion : _Minions)
if (minion != null)
minion.deleteMe();
_Minions.clear();
}
else if ((_LastAttackVsBaiumTime + 300000 < System.currentTimeMillis()) && npc.getCurrentHp() < ( ( npc.getMaxHp() * 3 ) / 4 ))
{
npc.setIsCastingNow(false); //just in case
npc.setTarget(npc);
npc.doCast(SkillTable.getInstance().getInfo(4135,1 ));
npc.setIsCastingNow(true);
}
else if (!_Zone.isInsideZone(npc))
npc.teleToLocation(115213,16623,10080);
}
}
return super.onAdvEvent(event, npc, player);
}
public String onTalk(L2Npc npc,L2PcInstance player)
{
int npcId = npc.getNpcId();
String htmltext = "";
if (_Zone == null)
_Zone = GrandBossManager.getInstance().getZone(113100,1450 0,10077);
if (_Zone == null)
return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>";
if (npcId == STONE_BAIUM && GrandBossManager.getInstance().getBossStatus(LIVE_ BAIUM) == ASLEEP)
{
if (_Zone.isPlayerAllowed(player))
{
// once Baium is awaken, no more people may enter until he dies, the server reboots, or
// 30 minutes pass with no attacks made against Baium.
GrandBossManager.getInstance().setBossStatus(LIVE_ BAIUM,AWAKE);
npc.deleteMe();
L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM,npc);
GrandBossManager.getInstance().addBoss(baium);
final L2Npc _baium = baium;
ThreadPoolManager.getInstance().scheduleGeneral(ne w Runnable() {
public void run()
{
try
{
_baium.setIsInvul(true);
_baium.setRunning();
_baium.broadcastPacket(new SocialAction(_baium.getObjectId(),2));
startQuestTimer("baium_wakeup",15000, _baium, null);
}
catch (Throwable e)
{
}
}
},100L);
}
else
htmltext = "Conditions are not right to wake up Baium";
}
else if (npcId == ANGELIC_VORTEX)
{
if (GrandBossManager.getInstance().getBossStatus(LIVE _BAIUM) == ASLEEP)
{
if (player.isFlying())
{
//print "Player "+player.getName()+" attempted to enter Baium's lair while flying!";
htmltext = "<html><body>Angelic Vortex:<br>You may not enter while flying a wyvern</body></html>";
}
else if (player.getQuestState("baium").getQuestItemsCount( 4295) > 0) // bloody fabric
{
player.getQuestState("baium").takeItems(4295,1);
// allow entry for the player for the next 30 secs (more than enough time for the TP to happen)
// Note: this just means 30secs to get in, no limits on how long it takes before we get out.
_Zone.allowPlayerEntry(player,30);
player.teleToLocation(113100,14500,10077);
}
else
htmltext = "<html><body>Angelic Vortex:<br>You do not have enough items</body></html>";
}
else
htmltext = "<html><body>Angelic Vortex:<br>You may not enter at this time</body></html>";
}
return htmltext;
}
public String onSpellFinished(L2Npc npc, L2PcInstance player, L2Skill skill)
{
if (npc.isInvul())
{
npc.getAI().setIntention(AI_INTENTION_IDLE);
return null;
}
else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
{
callSkillAI(npc);
}
return super.onSpellFinished(npc, player, skill);
}
public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
{
if (!_Zone.isInsideZone(attacker))
{
attacker.reduceCurrentHp(attacker.getCurrentHp(),a ttacker,false,false, null);
return super.onAttack(npc, attacker, damage, isPet);
}
if (npc.isInvul())
{
npc.getAI().setIntention(AI_INTENTION_IDLE);
return super.onAttack(npc, attacker, damage, isPet);
}
else if (npc.getNpcId() == LIVE_BAIUM && !npc.isInvul())
{
if (attacker.getMountType() == 1)
{
int sk_4258 = 0;
L2Effect[] effects = attacker.getAllEffects();
if (effects.length != 0 || effects != null)
{
for (L2Effect e : effects)
{
if (e.getSkill().getId() == 4258)
sk_4258 = 1;
}
}
if (sk_4258 == 0)
{
npc.setTarget(attacker);
npc.doCast(SkillTable.getInstance().getInfo(4258,1 ));
}
}
// update a variable with the last action against baium
_LastAttackVsBaiumTime = System.currentTimeMillis();
callSkillAI(npc);
}
return super.onAttack(npc, attacker, damage, isPet);
}
public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet)
{
cancelQuestTimer("baium_despawn", npc, null);
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
// spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair)
addSpawn(29055,115203,16620,10078,0,false,900000); ////should we teleport everyone out if the cubic despawns??
// "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs]
long respawnTime = (long)Config.Interval_Of_Baium_Spawn + Rnd.get(Config.Random_Of_Baium_Spawn);
GrandBossManager.getInstance().setBossStatus(LIVE_ BAIUM,DEAD);
startQuestTimer("baium_unlock", respawnTime, null, null);
// also save the respawn time so that the info is maintained past reboots
StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BA IUM);
info.set("respawn_time",(System.currentTimeMillis( )) + respawnTime);
GrandBossManager.getInstance().setStatsSet(LIVE_BA IUM,info);
if (getQuestTimer("skill_range", npc, null) != null)
getQuestTimer("skill_range", npc, null).cancel();
for (L2Attackable minion : _Minions)
if (minion != null)
minion.deleteMe();
_Minions.clear();