사이트 로그인
2016.05.20 18:36
수정 파일 : model/l1charater.java 파일 입니다
public void set_currentHp(int currentHp){
_currentHp = currentHp;
if (_currentHp >= get_temphp()){
stopHpRegeneration();
_currentHp = get_temphp();
}else if(_currentHp <= 0){
hpCK = false;
stopHpRegeneration();
stopMpRegeneration();
_currentHp = 0;
if(this instanceof L1PcInstance){
L1PcInstance cha = (L1PcInstance)this;
//-- 나에게 보내기
cha.sendPackets(cha.get_netConnection().bph().get_CharAction().S_DoAction(cha.get_objectId(), 8), true, true);
cha.set_status(8);
cha.set_isdead(true);
cha.set_food(0);
버프세팅(cha);
if(cha.get_level()>10)
{
CalcExp.getInstance().penal_exp(cha);
cha.sendPackets(cha.get_netConnection().bph().get_ocs().S_OwnCharStatus(cha), true);
}
if(cha.get_lawful() == 98303){ // 만라일때 않떨구는 부분 <<< 만라일때
} <<< 아무일 없이 닫음
if(cha.get_lawful() < 98303){
///////// 아이템 떨구는 부분..
int isdrop = 0; //아이템 떨굴 확률
int c_law = 0; //임시로 캐릭터의 라우풀수치로 떨구를 확률를 계산하기 위한..변수
//32926 --> 이게 풀카오 수치
//65536 --> 이게 뉴트럴 수치
//98303 --> 이게 만라풀 수치
c_law = (int)(cha.get_lawful()/10000); //캐릭터의 라우풀 수치 나누기 10000을 하여 확률을 계산
// 풀라일때는 않떨굼 , 뉴트럴 40%, 풀카오 70% 확률로 떨굼..
isdrop = cha.getRnd().nextInt(10)+1; //떨굴 확률...위한 변수
if(isdrop > c_law ){ // 랜덤으로 뽑아온 isdrop이 작을때... 아이템 떨구기 시작.
L1ItemInstance[] temp = cha.get_cil().getAllItems();
////////////////// 만라와 카오계산 떨굴 확률 및 갯수 계산
int count = 0; //떨구는 갯수
if(c_law == 3){ // 풀카오라면
count = cha.getRnd().nextInt(2) + 2;
}
else if(c_law == 4){
count = cha.getRnd().nextInt(3) + 1;
}
else if(c_law == 5){
count = cha.getRnd().nextInt(2) + 1;
}
else if(c_law == 6){
count = cha.getRnd().nextInt(2);
}
else if(c_law > 6){
count = cha.getRnd().nextInt(2);
}
for(int i=0 ; i < count ; ++i){
if(true){
int loc = cha.getRnd().nextInt(temp.length)+1;
if(temp[loc].getItem().getType2() == temp[loc].getItem().TYPE2_ETC) //만약 떨굴 아이템이 ETC 아이템이라면
{
while (temp[loc].getItem().getItemId() != 1);// ETC 아이템 중에서 아데나가 안될때까지..While 문 가동..
{
loc = cha.getRnd().nextInt(temp.length)+1;
}
}
if(temp[loc].isEquipped()){ // 착용중이였다면
if(temp[loc].getItem().getType2() == temp[loc].getItem().TYPE2_WEAPON){ // 무기라면
if((temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_TOHANDSWORD) ||
(temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_BOW) ||
(temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_BLUNT) ||
(temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_SPEER) ||
(temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_EDORYU) ||
(temp[loc].getItem().getType1() == temp[loc].getItem().WEAPON_CLAW)){
cha.set_TwoSword(false);
}
if(temp[loc].getItem().get_nameid().equalsIgnoreCase("$1063") ||
temp[loc].getItem().get_nameid().equalsIgnoreCase("$2003") ){ // 마나 지팡이 라면
cha.set_마나지팡이(false);
}
cha.set_무기(false);
cha.set_currentWeapon(0);
temp[loc].setEquipped(false);
cha.setDmg_small(0); // 스몰 데미지 설정.
cha.setDmg_large(0); // 라지 데미지 설정.
cha.setEnchantlvl(0); // 인첸 레벨 설정.
ItemHandler.getInstance().op(cha, temp[loc], false);
}else{ // 방어구 라면
ItemHandler.getInstance().handler(cha, temp[loc]);
ItemUse.getInstance().armor(cha, temp[loc]);
}
//-- 셋트 아이템
SetItem setitem = SetItemTable.getInstance().getTemplate(temp[loc].getItem().get_setItem());
if(setitem != null){
if(cha.setITEM(setitem.get_id(), setitem.get_count(), temp[loc].isEquipped())){
// 풀셋 옵션 적용
cha.set_풀셋(true);
ItemUse.getInstance().SetOption(cha, setitem, true, false);
}else{
if(cha.get_풀셋()){
// 플셋 옵션 해제
cha.set_풀셋(false);
ItemUse.getInstance().SetOption(cha, setitem, false, false);
}
}
}
}
temp[loc].set_x(cha.get_x());
temp[loc].set_y(cha.get_y());
temp[loc].set_map(cha.get_map());
while(true){
temp[loc].set_objectId(IdFactory.getInstance().getNextId());
if(L1World.getInstance().storeObject(temp[loc])){
break;
}
}
//-- 나에게 보내기
cha.sendPackets(cha.get_netConnection().bph().get_NewObjectPack().S_ITEMPack(temp[loc]), true, true);
cha.sendPackets(cha.get_netConnection().bph().get_Item().S_ItemDelete(temp[loc]), false);
cha.get_cil().removeItems(temp[loc]);
//-- 무게 세팅
cha.set_weight(cha.get_weight() - (temp[loc].getItem().getWeight()*temp[loc].getCount()));
cha.sendPackets(cha.get_netConnection().bph().S_Status(cha, 0), true);
}
}
}
}
}else if(this instanceof L1NpcInstance){
L1NpcInstance npc = (L1NpcInstance)this;
if((npc.getNpcTemplate().get_npcId()!=60503)&&(npc.getNpcTemplate().get_npcId()!=60504)){
if(npc.getNpcTemplate().getCandie()){ // 죽는 다면
//-- 월드맵 오브젝트 삭제
L1World.getInstance().removeVisibleObject(npc);
npc.AllsendPackets(npc.bph().get_CharAction().S_DoAction(npc.get_objectId(), 8), true);
npc.set_status(8);
npc.set_isdead(true);
if(npc instanceof L1MonsterInstance){
L1MonsterInstance mon = (L1MonsterInstance)this;
if(mon.Fight){ // 전투중이였다면
mon.Fight = false;
}
}else if(npc instanceof L1SummonInstance){
L1SummonInstance pet = (L1SummonInstance)this;
DiePet dp = new DiePet(pet);
dp.start();
}else{
ReSpawn rs = new ReSpawn(npc);
rs.start();
}
}else{ // 안죽는 다면
}
}
}
}else if(!_hpRegenActive && !is_isdead()){
hpCK = false;
startHpRegeneration();
}
if(!hpCK){
if(this instanceof L1PcInstance){
L1PcInstance cha = (L1PcInstance)this;
cha.sendPackets(cha.get_netConnection().bph().get_HP_MP_EXP().S_HPUpdate(cha), true);
if(cha.get_PartyOn()){ // 파티중이라면
cha.get_Party().SendMiniHP(cha, false);
}
}else if(this instanceof L1PetInstance){
L1PetInstance pet = (L1PetInstance)this;
pet.get_SummonOwn().sendPackets(pet.get_SummonOwn().get_netConnection().bph().S_HitRatio(pet), true);
}else if(this instanceof L1SummonInstance){
L1SummonInstance pet = (L1SummonInstance)this;
pet.get_SummonOwn().sendPackets(pet.get_SummonOwn().get_netConnection().bph().S_HitRatio(pet), true);
}
if(_currentHp >= get_temphp()){
hpCK = true;
}
}
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 소스자료는 직접 올려주세요 | 게임존 | 2017.06.06 | 550 |
209 | [요정]속성 마법에 의한 추가 데미지 | 연구사원 | 2016.06.07 | 94 |
208 | 특정지역 몬스터 아덴드랍율 높히기.txt [1] | 연구사원 | 2016.06.07 | 131 |
207 | NPC 호칭 달아주기 소스 | 연구사원 | 2016.06.07 | 74 |
206 | 환생 npc | LTE | 2016.06.06 | 136 |
205 | gm용 아이템 생성 npc [1] | LTE | 2016.06.06 | 212 |
204 | 워프 npc | LTE | 2016.06.06 | 58 |
203 | 성형 npc | LTE | 2016.06.06 | 67 |
202 | 수동 스킬마스터 | LTE | 2016.06.06 | 323 |
201 | 홍보코인 상점npc | LTE | 2016.06.06 | 131 |
200 | 자동전직 npc | LTE | 2016.06.06 | 108 |
199 | 개경소스 [1] | 연구사원 | 2016.06.03 | 344 |
198 | 공성전 군주지급템에 관한 소스 | 연구사원 | 2016.06.02 | 87 |
197 | 마방 및 마법데미지 본x화 [1] | 연구사원 | 2016.06.02 | 595 |
196 | 정확한 마방값을 불러오자 | 김닉넴 | 2016.05.20 | 196 |
195 | 버그사용자에게 몬스터가 말하기 | | 김닉넴 | 2016.05.20 | 163 |
194 | 윈성 용병대장에게서 폭풍의칼날단 받는소스 입니다 | 김닉넴 | 2016.05.20 | 89 |
193 | 빈주문서추가 | 김닉넴 | 2016.05.20 | 52 |
192 | 마방이랑 옵션 완벽 적용 [1] | 김닉넴 | 2016.05.20 | 218 |
191 | 공성시간 자동 돌리기 | 김닉넴 | 2016.05.20 | 84 |
190 | 재질에 의한 타격치.. | 김닉넴 | 2016.05.20 | 58 |
189 | 헤이스트 아이템 헤이스트효과구현 | 김닉넴 | 2016.05.20 | 35 |
188 | 언데드계열 힐주기 | 김닉넴 | 2016.05.20 | 28 |
187 | 덱방을 알아보자.. | 김닉넴 | 2016.05.20 | 49 |
186 | 마법사_에볼 | 김닉넴 | 2016.05.20 | 70 |
185 | 마법서복권 | 김닉넴 | 2016.05.20 | 65 |
184 | 마법투구 헤이스트추가 | 김닉넴 | 2016.05.20 | 37 |
183 | 마수군왕의 징표함 적용 | 김닉넴 | 2016.05.20 | 31 |
» | 만라우풀일때 아이템 안떨구기 | 김닉넴 | 2016.05.20 | 118 |
181 | 말하는 두루마리 무게버그수정.txt | 김닉넴 | 2016.05.20 | 50 |
180 | 몬스터 벽인식 | 김닉넴 | 2016.05.20 | 148 |
179 | 몹 HP게이지 만들기 [3] | 김닉넴 | 2016.05.20 | 185 |
178 | GM명령어 아크변신 | 김닉넴 | 2016.05.20 | 138 |
177 | 간단 낚시 버그 | 김닉넴 | 2016.05.20 | 173 |
176 | UI5 Key [출처] UI5 Key | 김닉넴 | 2016.05.20 | 31 |
175 | UI5 서버버전패킷 & 언노운 | 김닉넴 | 2016.05.20 | 51 |
174 | UI5 옵코드 | 김닉넴 | 2016.05.20 | 245 |
173 | 린드비오르 레이드 맵 / 확인불명 신규맵 | 김닉넴 | 2016.05.20 | 49 |
172 | 4.20일자 key 언노운 서버버전 옵코드 | 김닉넴 | 2016.05.20 | 150 |
171 | 신규 spr | 김닉넴 | 2016.05.20 | 194 |
170 | 두번째 인던맵 입니다 | 김닉넴 | 2016.05.20 | 77 |
169 | 인던 녹색 메세지 패킷 | 김닉넴 | 2016.05.20 | 29 |
168 | 이블 트릭.. 이블 리버스.. 소스(?) 일까나..ㅎㅎ | 김닉넴 | 2016.05.20 | 104 |
167 | A* 알고리즘 (몬스터 길찾기) | 김닉넴 | 2016.05.20 | 286 |
166 | [에바/일팩] * 귓속말 글자수 늘리는 방법 | 김닉넴 | 2016.05.20 | 23 |
165 | [에바/일팩] * 3.63혈맹창 리뉴얼 | 김닉넴 | 2016.05.20 | 59 |
164 | [점팩] * 드레이크인형 | 김닉넴 | 2016.05.20 | 55 |
163 | [에바/일팩] * 바운스헌터 및 신규변신 | 김닉넴 | 2016.05.20 | 83 |
162 | [에바/일팩] 스턴 확률조정법 | 김닉넴 | 2016.05.20 | 146 |
161 | [150811] Opcodes | 김닉넴 | 2016.05.20 | 402 |
160 | PK 승리시 깃털 뺏기 | 김닉넴 | 2016.05.20 | 59 |