Форум администраторов игровых серверов

Форум администраторов игровых серверов (https://forum.zone-game.info/TT.php)
-   Работа со скриптами (https://forum.zone-game.info/forumdisplay.php?f=37)
-   -   Pvp Script! (https://forum.zone-game.info/showthread.php?t=10166)

IceAge 17.09.2010 17:08

Pvp Script!
 
Hello,
I was wondering, if there is possible for someone to create a script for a PvePvp server.
What I am looking for is that I want to make a server where when you pvp the one who dies to have a chance for lets say 30-50% to drop between 1-2 items ( weapons or armors and not pots , mats and so on ) .
Also , I want this to be made only in specific zones like BS and such, where people , will want to pvp and others who just want Pve , to not engage in this pvp zones where you may drop items.
So when people will enter in BS area, a message to be displayed that they entered in a pvp zone where they may or will drop items. In this way, I think the pvp will be a little more enterteining.
I know, server must be balanced ( i am talking about spoil rates ) in order to not make people to quit after they have lose some items.
Anyway , hope you understand what i am saying and if someone can or have any other ideea, please let me know.

PS: English replays will be better, but not neccesary as I can translate with google ( not a good way, but still ) .

Ozzy 17.09.2010 17:26

Re: Pvp Script!
 
Для тех кто не понял - человеку требуется создание сценария для PVE-PVP сервера. Требуется сделать чтобы в определенных локациях, например Blazing Swamp c чаров, которые погибают в PVP выпадало 2-3 итема (не ресурсов, а оружие и броня). В других же местах, не в PVP зонах чтобы все оставалось так же как и на обычном сервере. Так же необходимо делать системное сообщение при входе в PVP зону а ля "Вы вошли в PVP зону, где при смерти можно потерять ценные вещи". Так же вы можете написать если у вас есть какие-то другие идеи. Желательно использование английского языка.

Hi, man. I just translated your post to language, that is most friendly for our users.

IceAge 17.09.2010 20:42

Re: Pvp Script!
 
Much appreciate it. Hope for some responses.
Thank you.

DreamTheater 18.09.2010 17:22

Re: Pvp Script!
 
Открываем исходники, находим класс L2PcInstance.java. Внутри класса находим следующий участок кода:
PHP код:

boolean isKillerNpc = (killer instanceof L2Npc); 

PHP код:

if (getKarma() > && getPkKills() >= pkLimit)
            {
                
isKarmaDrop true;
                
dropPercent Config.KARMA_RATE_DROP;
                
dropEquip Config.KARMA_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.KARMA_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.KARMA_RATE_DROP_ITEM;
                
dropLimit Config.KARMA_DROP_LIMIT;
            }
            else if (
isKillerNpc && getLevel() > && !isFestivalParticipant())
            {
                
dropPercent Config.PLAYER_RATE_DROP;
                
dropEquip Config.PLAYER_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.PLAYER_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.PLAYER_RATE_DROP_ITEM;
                
dropLimit Config.PLAYER_DROP_LIMIT;
            } 

Меняем код вот так:
PHP код:

boolean isKillerPlayer = (killer instanceof L2PcInstance);
boolean isInsidePvPZone isInsideZone(ZONE_PVP); 

PHP код:

if (getKarma() > && getPkKills() >= pkLimit)
            {
                
isKarmaDrop true;
                
dropPercent Config.KARMA_RATE_DROP;
                
dropEquip Config.KARMA_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.KARMA_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.KARMA_RATE_DROP_ITEM;
                
dropLimit Config.KARMA_DROP_LIMIT;
            }
            else if (
isKillerPlayer && isInsidePvPZone)
            {
                
dropPercent Config.PLAYER_RATE_DROP;
                
dropEquip Config.PLAYER_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.PLAYER_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.PLAYER_RATE_DROP_ITEM;
                
dropLimit Config.PLAYER_DROP_LIMIT;
            } 

В конфиге rates.properties есть вот такие настройки:
Код:

# ---------------------------------------------------------------------------
# Player Drops (values are set in PERCENTS)
# ---------------------------------------------------------------------------
PlayerDropLimit = 0
# in %
PlayerRateDrop = 0
# in %
PlayerRateDropItem = 0
# in %
PlayerRateDropEquip = 0
# in %
PlayerRateDropEquipWeapon = 0

Настраиваете дроп как Вам нравится.

PS. Оззи, переведите ему на инглиш пожалуйста.

Array 18.09.2010 18:44

Re: Pvp Script!
 
Translation:
Open source code, find class L2PcInstance.java. And find there the following code:
PHP код:

boolean isKillerNpc = (killer instanceof L2Npc); 

PHP код:

if (getKarma() > && getPkKills() >= pkLimit)
            {
                
isKarmaDrop true;
                
dropPercent Config.KARMA_RATE_DROP;
                
dropEquip Config.KARMA_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.KARMA_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.KARMA_RATE_DROP_ITEM;
                
dropLimit Config.KARMA_DROP_LIMIT;
            }
            else if (
isKillerNpc && getLevel() > && !isFestivalParticipant())
            {
                
dropPercent Config.PLAYER_RATE_DROP;
                
dropEquip Config.PLAYER_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.PLAYER_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.PLAYER_RATE_DROP_ITEM;
                
dropLimit Config.PLAYER_DROP_LIMIT;
            } 

Change it in a such way:
PHP код:

boolean isKillerPlayer = (killer instanceof L2PcInstance);
boolean isInsidePvPZone isInsideZone(ZONE_PVP); 

PHP код:

if (getKarma() > && getPkKills() >= pkLimit)
            {
                
isKarmaDrop true;
                
dropPercent Config.KARMA_RATE_DROP;
                
dropEquip Config.KARMA_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.KARMA_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.KARMA_RATE_DROP_ITEM;
                
dropLimit Config.KARMA_DROP_LIMIT;
            }
            else if (
isKillerPlayer && isInsidePvPZone)
            {
                
dropPercent Config.PLAYER_RATE_DROP;
                
dropEquip Config.PLAYER_RATE_DROP_EQUIP;
                
dropEquipWeapon Config.PLAYER_RATE_DROP_EQUIP_WEAPON;
                
dropItem Config.PLAYER_RATE_DROP_ITEM;
                
dropLimit Config.PLAYER_DROP_LIMIT;
            } 

In the config rates.properties you have the following settings:
Код:

# ---------------------------------------------------------------------------
# Player Drops (values are set in PERCENTS)
# ---------------------------------------------------------------------------
PlayerDropLimit = 0
# in %
PlayerRateDrop = 0
# in %
PlayerRateDropItem = 0
# in %
PlayerRateDropEquip = 0
# in %
PlayerRateDropEquipWeapon = 0

Configure drop as you like.

DreamTheater 18.09.2010 18:52

Re: Pvp Script!
 
Я так понимаю под ZONE_PVP подразумеваются зоны вроде MDT и колизея. Чтобы такая фишка работала просто во всех зонах, где возможно бить персонажей, то вместо boolean isInsidePvPZone = isInsideZone(ZONE_PVP); нужно написать boolean isInsidePvPZone = !isInsideZone(ZONE_PEACE);

Array 18.09.2010 19:28

Re: Pvp Script!
 
Цитата:

Сообщение от DreamTheater (Сообщение 88530)
I think, ZONE_PVP zone like MDT and the Coliseum. To do this feature work in all zones, where it is possible to beat the characters, change boolean isInsidePvPZone = isInsideZone (ZONE_PVP); To isInsidePvPZone =! IsInsideZone (ZONE_PEACE);

По-моему, лучше будет изменить тип тех зон, в которых IceAge захочет устроить веселье игрокам. В zone.xml добавить новую зону, поставить её тип="..." (Arena, или лучше сделать новый тип зоны )

I think it would be better to change type of zones, in which IceAge wants to make fun. I mean in zone.xml add a new one, and set type="..." ( Arena? or it would be better to create new type of zone.)

DreamTheater 18.09.2010 22:56

Re: Pvp Script!
 
Можно и так :)

IceAge 21.09.2010 20:05

Re: Pvp Script!
 
Hm , pretty nice tips you gave me here. I will however try them this week as right now I am currently trying to assamble my server.
Thanks and i'll keep you updated with everything.


Текущее время: 18:09. Часовой пояс GMT +3.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot