Перейти к содержанию
Авторизация  
knaif

Под Скажите Пожалуйста Как Это Сделать

Рекомендуемые сообщения

Всем привет

помогите пожалуйста

как можно сделать на сборке Evermore вот такую феню ???

 

Анимация при удачном и неудачном открытии сундуков

При неудчном открытии сундука он может стать ловушкой(взорвёться или наложет какое то проклятие)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
ядро

Ну, а если точнее:

gameserver/model/actor/instance/L2ChestInstance.class

gameserver/handler/skillhandlers/Unlock.class

 

Декомпилируйте и реализовывайте.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

А что именно там надо под править ??? :girl_devil:

Изменено пользователем knaif

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст
// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov Date: 06.08.2012 22:28:16
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: L2ChestInstance.java

package evermore.gameserver.model.actor.instance;

import evermore.gameserver.datatables.NpcTable;
import evermore.gameserver.datatables.others.SkillTable;
import evermore.gameserver.model.L2Character;
import evermore.gameserver.model.L2Skill;
import evermore.gameserver.serverpackets.MagicSkillUser;
import evermore.gameserver.serverpackets.SystemMessage;
import evermore.gameserver.templates.L2NpcTemplate;
import evermore.util.Rnd;

// Referenced classes of package evermore.gameserver.model.actor.instance:
// L2MonsterInstance

public final class L2ChestInstance extends L2MonsterInstance
{

public L2ChestInstance(int objectId, L2NpcTemplate template)
{
super(objectId, template);
_isInteracted = false;
_specialDrop = false;
}

public void onSpawn()
{
super.onSpawn();
_isInteracted = false;
_specialDrop = false;
setMustRewardExpSp(true);
}

public synchronized boolean isInteracted()
{
return _isInteracted;
}

public synchronized void setInteracted()
{
_isInteracted = true;
}

public synchronized boolean isSpecialDrop()
{
return _specialDrop;
}

public synchronized void setSpecialDrop()
{
_specialDrop = true;
}

public void doItemDrop(L2NpcTemplate npcTemplate, L2Character lastAttacker)
{
int id = getTemplate().npcId;
if(!_specialDrop)
if(id >= 18265 && id <= 18286)
id += 3536;
else
if(id == 18287 || id == 18288)
id = 21671;
else
if(id == 18289 || id == 18290)
id = 21694;
else
if(id == 18291 || id == 18292)
id = 21717;
else
if(id == 18293 || id == 18294)
id = 21740;
else
if(id == 18295 || id == 18296)
id = 21763;
else
if(id == 18297 || id == 18298)
id = 21786;
super.doItemDrop(NpcTable.getInstance().getTemplate(id), lastAttacker);
}

public void chestTrap(L2Character player)
{
int trapSkillId = 0;
int rnd = Rnd.get(120);
if(getTemplate().level >= 61)
{
if(rnd >= 90)
trapSkillId = 4139;
else
if(rnd >= 50)
trapSkillId = 4118;
else
if(rnd >= 20)
trapSkillId = 1167;
else
trapSkillId = 223;
} else
if(getTemplate().level >= 41)
{
if(rnd >= 90)
trapSkillId = 4139;
else
if(rnd >= 60)
trapSkillId = 96;
else
if(rnd >= 20)
trapSkillId = 1167;
else
trapSkillId = 4118;
} else
if(getTemplate().level >= 21)
{
if(rnd >= 80)
trapSkillId = 4139;
else
if(rnd >= 50)
trapSkillId = 96;
else
if(rnd >= 20)
trapSkillId = 1167;
else
trapSkillId = 129;
} else
if(rnd >= 80)
trapSkillId = 4139;
else
if(rnd >= 50)
trapSkillId = 96;
else
trapSkillId = 129;
player.sendPacket(SystemMessage.sendString("There was a trap!"));
handleCast(player, trapSkillId);
}

private boolean handleCast(L2Character player, int skillId)
{
int skillLevel = 1;
byte lvl = getTemplate().level;
if(lvl > 20 && lvl <= 40)
skillLevel = 3;
else
if(lvl > 40 && lvl <= 60)
skillLevel = 5;
else
if(lvl > 60)
skillLevel = 6;
if(player.isDead() || !player.isVisible() || !player.isInsideRadius(this, getDistanceToWatchObject(player), false, false))
return false;
L2Skill skill = SkillTable.getInstance().getInfo(skillId, skillLevel);
if(player.getFirstEffect(skill) == null)
{
skill.getEffects(this, player);
broadcastPacket(new MagicSkillUser(this, player, skill.getId(), skillLevel, skill.getHitTime(), 0L));
return true;
} else
{
return false;
}
}

public boolean isMovementDisabled()
{
if(super.isMovementDisabled())
return true;
return !isInteracted();
}

public boolean hasRandomAnimation()
{
return false;
}

private volatile boolean _isInteracted;
private volatile boolean _specialDrop;
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст
// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov Date: 06.08.2012 22:29:38
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: Unlock.java

package evermore.gameserver.handler.skillhandlers;

import evermore.gameserver.ai.CtrlIntention;
import evermore.gameserver.ai.L2CharacterAI;
import evermore.gameserver.handler.ISkillHandler;
import evermore.gameserver.model.*;
import evermore.gameserver.model.actor.instance.L2ChestInstance;
import evermore.gameserver.model.actor.instance.L2DoorInstance;
import evermore.gameserver.network.SystemMessageId;
import evermore.gameserver.serverpackets.*;
import evermore.gameserver.skills.Formulas;
import evermore.util.Rnd;

public class Unlock
implements ISkillHandler
{

public Unlock()
{
}

public void useSkill(L2Character activeChar, L2Skill skill, L2Object targets[])
{
L2Object targetList[] = skill.getTargetList(activeChar);
if(targetList == null)
return;
for(int index = 0; index < targetList.length; index++)
{
L2Object target = targetList[index];
boolean success = Formulas.getInstance().calculateUnlockChance(skill);
if(target instanceof L2DoorInstance)
{
L2DoorInstance door = (L2DoorInstance)target;
if(!door.isUnlockable())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.UNABLE_TO_UNLOCK_DOOR));
activeChar.sendPacket(new ActionFailed());
return;
}
if(success && door.getOpen())
{
door.openMe();
door.onOpen();
SystemMessage systemmessage = new SystemMessage(SystemMessageId.S1_S2);
systemmessage.addString("Unlock the door!");
activeChar.sendPacket(systemmessage);
} else
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.FAILED_TO_UNLOCK_DOOR));
}
continue;
}
if(!(target instanceof L2ChestInstance))
continue;
L2ChestInstance chest = (L2ChestInstance)targetList[index];
if(chest.getCurrentHp() <= 0.0D || chest.isInteracted())
{
activeChar.sendPacket(new ActionFailed());
return;
}
int chestChance = 0;
int chestGroup = 0;
int chestTrapLimit = 0;
if(chest.getLevel() > 60)
chestGroup = 4;
else
if(chest.getLevel() > 40)
chestGroup = 3;
else
if(chest.getLevel() > 30)
chestGroup = 2;
else
chestGroup = 1;
switch(chestGroup)
{
case 1: // '\001'
if(skill.getLevel() > 10)
chestChance = 100;
else
if(skill.getLevel() >= 3)
chestChance = 50;
else
if(skill.getLevel() == 2)
chestChance = 45;
else
if(skill.getLevel() == 1)
chestChance = 40;
chestTrapLimit = 10;
break;

case 2: // '\002'
if(skill.getLevel() > 12)
chestChance = 100;
else
if(skill.getLevel() >= 7)
chestChance = 50;
else
if(skill.getLevel() == 6)
chestChance = 45;
else
if(skill.getLevel() == 5)
chestChance = 40;
else
if(skill.getLevel() == 4)
chestChance = 35;
else
if(skill.getLevel() == 3)
chestChance = 30;
chestTrapLimit = 30;
break;

case 3: // '\003'
if(skill.getLevel() >= 14)
chestChance = 50;
else
if(skill.getLevel() == 13)
chestChance = 45;
else
if(skill.getLevel() == 12)
chestChance = 40;
else
if(skill.getLevel() == 11)
chestChance = 35;
else
if(skill.getLevel() == 10)
chestChance = 30;
else
if(skill.getLevel() == 9)
chestChance = 25;
else
if(skill.getLevel() == :girl_devil:
chestChance = 20;
else
if(skill.getLevel() == 7)
chestChance = 15;
else
if(skill.getLevel() == 6)
chestChance = 10;
chestTrapLimit = 50;
break;

case 4: // '\004'
if(skill.getLevel() >= 14)
chestChance = 50;
else
if(skill.getLevel() == 13)
chestChance = 45;
else
if(skill.getLevel() == 12)
chestChance = 40;
else
if(skill.getLevel() == 11)
chestChance = 35;
chestTrapLimit = 80;
break;
}
if(Rnd.get(100) <= chestChance)
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 3));
chest.setSpecialDrop();
chest.setMustRewardExpSp(false);
chest.setInteracted();
chest.reduceCurrentHp(99999999D, activeChar, null);
continue;
}
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 13));
if(Rnd.get(100) < chestTrapLimit)
chest.chestTrap(activeChar);
chest.setInteracted();
chest.addDamageHate(activeChar, 0, 1);
chest.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, activeChar);
}

}

public evermore.gameserver.model.L2Skill.SkillType[] getSkillIds()
{
return SKILL_IDS;
}

private static final evermore.gameserver.model.L2Skill.SkillType SKILL_IDS[];

static
{
SKILL_IDS = (new evermore.gameserver.model.L2Skill.SkillType[] {
evermore.gameserver.model.L2Skill.SkillType.UNLOCK
});
}
}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Вот эти два файла скажите где именно ??? если вас не затруднит

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...