윈성 용병대장에게서 폭풍의칼날단 받는소스 입니다
L1NpcInstance.java
public void onTalkAction(L1PcInstance cha){
//
switch(getNpcTemplate().get_npcId()){
//
case 70191://할트 (윈성 용병대장)
cha.sendPackets(cha.get_netConnection().bph().get_NPCTalk().S_NPCTalkReturn(this, "halt1"), true);
break;
public void onFinalAction(L1PcInstance cha, String action){
if(!distance(this, cha, 5)){ // 5셀 안에 있다면
if(action.equalsIgnoreCase("haste")){ // 헤이스트사
if(!cha.get_Buff_헤이스트()){
cha.set_Buff_헤이스트(true);
// 중략
}else if(action.equalsIgnoreCase("demand")){ // 할트 (윈성 용병단)
if(cha.get_PetOn()){ // 펫이 있다면
}else{ // 펫이 없다면
int 소환갯수 = cha.get_cha() / 8;
int 소환몹 = 0;
if(소환갯수>3) 소환갯수 = 3 ;
소환몹 = 100060;
for(int i=0 ; i<소환갯수 ; ++i){
try{
L1Npc template1 = MonsterTable.getInstance().getTemplate(소환몹);
L1SummonInstance pet = new L1SummonInstance(template1);
Object[] parameters = {template1};
pet = (L1SummonInstance) Class.forName("psjump.server.model.L1SummonInstance").getConstructors()[0].newInstance(parameters);
pet.setNPCTemplateType("L1SummonInstance");
pet.set_isdead(false);
pet.setAttackable(false);
switch(i){
case 0:
pet.set_x(cha.get_x()+cha.getRnd().nextInt(3));
pet.set_y(cha.get_y()+cha.getRnd().nextInt(3));
break;
case 1:
pet.set_x(cha.get_x()-cha.getRnd().nextInt(3));
pet.set_y(cha.get_y()-cha.getRnd().nextInt(3));
break;
case 2:
pet.set_x(cha.get_x()-cha.getRnd().nextInt(3));
pet.set_y(cha.get_y()+cha.getRnd().nextInt(3));
break;
case 3:
pet.set_x(cha.get_x()+cha.getRnd().nextInt(3));
pet.set_y(cha.get_y()-cha.getRnd().nextInt(3));
break;
default:
pet.set_x(cha.get_x()+cha.getRnd().nextInt(3));
pet.set_y(cha.get_y()+cha.getRnd().nextInt(3));
break;
}
pet.setHomeX(pet.get_x());
pet.setHomeY(pet.get_y());
pet.set_map(cha.get_map());
pet.set_heading(4);
pet.set_level(template1.get_level());
pet.set_exp(82);
pet.set_lawful(1);
pet.set_temphp(template1.getHp());
pet.set_maxHp(template1.getHp());
pet.setcurrentHp(template1.getHp());
pet.set_tempmp(template1.getMp());
pet.set_maxBaseMp(template1.getMp());
pet.setcurrentMp(template1.getMp());
pet.set_physicalAttackSmall(template1.get_damage());
pet.set_physicalAttackLarge(template1.get_damage());
pet.set_ac(10);
pet.set_Mr(template1.get_mr());
pet.set_Agro(template1.is_agro());
pet.set_Agrocoi(template1.is_agrocoi());
pet.set_Agrososc(template1.is_agrososc());
pet.set_gfxid(template1.get_gfxid());
pet.set_nameid(template1.get_nameid());
while(true){
pet.set_objectId(IdFactory.getInstance().getNextId());
if(L1World.getInstance().storeObject(pet)){
// 현재좌표의 월드맵포인트를 임시로 저장
pet.set_wmp(WorldMapPoint.getInstance().get_map(pet.get_x(), pet.get_y(), pet.get_map()));
WorldMapPoint.getInstance().AddObject(pet.get_x(), pet.get_y(), pet.get_map() ,pet.get_objectId());
break;
}
}
pet.set_SummonOwn(cha);
if(cha.get_PetOn()){ // 펫이 있다면
cha.get_pet().펫추가(pet);
}else{ // 펫이 없다면
cha.set_PetOn(true);
cha.set_pet(new PetSystem());
cha.get_pet().펫추가(pet);
cha.get_pet().주인설정(cha);
}
pet.Start();
}catch (Exception e){
System.out.println(e);
}
}
}
이미 하신분들은 다하셨겠지만
할짓도 없고 올만에 소스나 올려볼까 해서 이거라도 올려봅니다 ㅎ
onTalkAction 부분에서 대화창이 아무나 다 소환을 할수 있게 되어있습니다.
그래서 그부분에
(성혈이 아닐경우 cha.sendPackets(cha.get_netConnection().bph().get_NPCTalk().S_NPCTalkReturn(this, "halt4"), true);)
성혈을 검색하는 구문을 넣으셔서 성혈만 소환할수있게 사용할수있습니다.
소환몹 부분은
100060 폭풍의칼날단 L1Monster 45 100 50 0 0 0 30 20 16 18 12 12 0 1025 0 small 0 0 0 0 0 0 0 0 0 0 2 148 '폭풍의 칼날단' 1 0 0 0 0 0 0 0 0 620 950
바로 위에부분을 나비캣 Monster에 넣으셔서 사용하시면됩니다.
없으신분들을 위한것으로 필요하신대로 사용하시면됩니다.
소환갯수는 카리에 관계있도록 되어있습니다.
[출처] 윈성 용병대장에게서 폭풍의칼날단 받는소스 입니다 (비공개 카페)

준희미니 님의 최근 댓글
rt 2021 05.25 ㄳ 2021 05.11 ㄳ 2021 05.11 rt 2021 05.09 rt 2021 04.25