Jump to content

Question

2 answers to this question

Recommended Posts

  • 0
Posted

It's not because you create another thread you will have another answer.

 

Read/work on my answer : http://maxcheaters.com/forum/index.php?topic=216847.msg1880491#msg1880491

 

Here's a full example of implementing a zoneType, in this case, artifact zones to restrict cast : http://trac.assembla.com/acis_project/changeset/115

  • 0
Posted

@Tryskell I am trying to create a new area see if I'm on track.

/*
* 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 com.l2jserver.gameserver.model.zone.type;

import java.util.Random;
import java.util.StringTokenizer;

import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.zone.L2ZoneType;

/**
* @author Usuario
*
*/
public class L2PvPZone extends L2ZoneType
{

public Random randomNome = new Random();
public String nick[] = { "tessRe" ,"asaEwRe", "fewrAr32" };

/**
 * @param id
 */
protected L2PvPZone(int id)
{
	super(id);
}


@Override
public void onDieInside(L2Character character)
{


}

@Override
protected void onEnter(L2Character character)
{
	onArea(character,null);
}

public void onArea(L2Character cr ,L2PcInstance player)
{
	cr.setInsideZone(L2Character.ZONE_PEACE, false); //noPeaceZone
	String nickAtual = nick(cr.getName()); //store old name
	cr.setName("sErdtR"); //add new name for test

}

public String nick(String _nome){
	return _nome;
}

   
@Override
protected void onExit(L2Character character)
{

}


@Override
public void onReviveInside(L2Character character)
{
	// TODO Auto-generated method stub

}

}

 

 

------

 

Could you give me an example of how to accomplish this?

 

-------------

would that be?

 

creates a variable to store Name

 

public String _nickAtual= null;

 

@Override
    protected void onEnter(L2Character character)
    {
        character.setInsideZone(L2Character.ZONE_PEACE, false);
        //if (character instanceof L2PcInstance)
        //{
            _nickAtual = ((L2PcInstance)character).getName();
            ((L2PcInstance)character).setName("ZdRrgAG");
            ((L2PcInstance)character).broadcastUserInfo();
        //}

    }
    
    @Override
    protected void onExit(L2Character character)
    {
        ((L2PcInstance)character).setName(_nickAtual);
       ((L2PcInstance)character).broadcastUserInfo();
        
    }

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
Answer this question...

×   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.



×
×
  • Create New...