I am using notepad++ and another program to search ... i need to find that declaration,but,look what i found in char_battle.cpp
PHP Code:
void CHARACTER::Reward(bool bItemDrop)
{
if (GetRaceNum() == 5001) // 왜구는 돈을 무조건 드롭
{
PIXEL_POSITION pos;
if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), GetX(), GetY(), pos))
return;
LPITEM item;
int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(NULL) / 100;
iGold *= GetGoldMultipler();
int iSplitCount = number(25, 35);
sys_log(0, "WAEGU Dead gold %d split %d", iGold, iSplitCount);
for (int i = 1; i <= iSplitCount; ++i)
{
if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
{
if (i != 0)
{
pos.x = number(-7, 7) * 20;
pos.y = number(-7, 7) * 20;
pos.x += GetX();
pos.y += GetY();
}
item->AddToGround(GetMapIndex(), pos);
item->StartDestroyEvent();
}
}
return;
}
//PROF_UNIT puReward("Reward");
LPCHARACTER pkAttacker = DistributeExp();
if (!pkAttacker)
return;
//PROF_UNIT pu1("r1");
if (pkAttacker->IsPC())
{
if (GetLevel() - pkAttacker->GetLevel() >= -10)
if (pkAttacker->GetRealAlignment() < 0)
{
if (pkAttacker->IsEquipUniqueItem(UNIQUE_ITEM_FASTER_ALIGNMENT_UP_BY_KILL))
pkAttacker->UpdateAlignment(14);
else
pkAttacker->UpdateAlignment(7);
}
else
pkAttacker->UpdateAlignment(2);
pkAttacker->SetQuestNPCID(GetVID());
quest::CQuestManager::instance().Kill(pkAttacker->GetPlayerID(), GetRaceNum());
CHARACTER_MANAGER::instance().KillLog(GetRaceNum());
if (!number(0, 9))
{
if (pkAttacker->GetPoint(POINT_KILL_HP_RECOVERY))
{
int iHP = pkAttacker->GetMaxHP() * pkAttacker->GetPoint(POINT_KILL_HP_RECOVERY) / 100;
pkAttacker->PointChange(POINT_HP, iHP);
CreateFly(FLY_HP_SMALL, pkAttacker);
}
if (pkAttacker->GetPoint(POINT_KILL_SP_RECOVER))
{
int iSP = pkAttacker->GetMaxSP() * pkAttacker->GetPoint(POINT_KILL_SP_RECOVER) / 100;
pkAttacker->PointChange(POINT_SP, iSP);
CreateFly(FLY_SP_SMALL, pkAttacker);
}
}
}
//pu1.Pop();
if (!bItemDrop)
return;
PIXEL_POSITION pos = GetXYZ();
if (!SECTREE_MANAGER::instance().GetMovablePosition(GetMapIndex(), pos.x, pos.y, pos))
return;
//
// 돈 드롭
//
//PROF_UNIT pu2("r2");
if (test_server)
sys_log(0, "Drop money : Attacker %s", pkAttacker->GetName());
RewardGold(pkAttacker);
//pu2.Pop();
//
// 아이템 드롭
//
//PROF_UNIT pu3("r3");
LPITEM item;
static std::vector<LPITEM> s_vec_item;
s_vec_item.clear();
if (ITEM_MANAGER::instance().CreateDropItem(this, pkAttacker, s_vec_item))
{
if (s_vec_item.size() == 0);
else if (s_vec_item.size() == 1)
{
item = s_vec_item[0];
item->AddToGround(GetMapIndex(), pos);
if (CBattleArena::instance().IsBattleArenaMap(pkAttacker->GetMapIndex()) == false)
{
item->SetOwnership(pkAttacker);
}
item->StartDestroyEvent();
pos.x = number(-7, 7) * 20;
pos.y = number(-7, 7) * 20;
pos.x += GetX();
pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName());
}
else
{
int iItemIdx = s_vec_item.size() - 1;
std::priority_queue<std::pair<int, LPCHARACTER> > pq;
int total_dam = 0;
for (TDamageMap::iterator it = m_map_kDamage.begin(); it != m_map_kDamage.end(); ++it)
{
int iDamage = it->second.iTotalDamage;
if (iDamage > 0)
{
LPCHARACTER ch = CHARACTER_MANAGER::instance().Find(it->first);
if (ch)
{
pq.push(std::make_pair(iDamage, ch));
total_dam += iDamage;
}
}
}
std::vector<LPCHARACTER> v;
while (!pq.empty() && pq.top().first * 10 >= total_dam)
{
v.push_back(pq.top().second);
pq.pop();
}
if (v.empty())
{
// 데미지를 특별히 많이 준 사람이 없으니 소유권 없음
while (iItemIdx >= 0)
{
item = s_vec_item[iItemIdx--];
if (!item)
{
sys_err("item null in vector idx %d", iItemIdx + 1);
continue;
}
item->AddToGround(GetMapIndex(), pos);
// 10% 이하 데미지 준 사람끼리는 소유권없음
//item->SetOwnership(pkAttacker);
item->StartDestroyEvent();
pos.x = number(-7, 7) * 20;
pos.y = number(-7, 7) * 20;
pos.x += GetX();
pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
}
}
else
{
// 데미지 많이 준 사람들 끼리만 소유권 나눠가짐
std::vector<LPCHARACTER>::iterator it = v.begin();
while (iItemIdx >= 0)
{
item = s_vec_item[iItemIdx--];
if (!item)
{
sys_err("item null in vector idx %d", iItemIdx + 1);
continue;
}
item->AddToGround(GetMapIndex(), pos);
LPCHARACTER ch = *it;
if (ch->GetParty())
ch = ch->GetParty()->GetNextOwnership(ch, GetX(), GetY());
++it;
if (it == v.end())
it = v.begin();
if (CBattleArena::instance().IsBattleArenaMap(ch->GetMapIndex()) == false)
{
item->SetOwnership(ch);
}
item->StartDestroyEvent();
pos.x = number(-7, 7) * 20;
pos.y = number(-7, 7) * 20;
pos.x += GetX();
pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName());
}
}
}
}
m_map_kDamage.clear();
}
And :
PHP Code:
int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(NULL) / 100;
iGold *= GetGoldMultipler();
int iSplitCount = number(25, 35);
EDIT : i believe that "GetMobTable()" is a structure since there are so many getmobtable.blablabla in files ... but i can't find it
REEDIT : i found these in char.h
PHP Code:
const TMobTable & GetMobTable() const;
BYTE GetMobRank() const;
BYTE GetMobBattleType() const;
BYTE GetMobSize() const;
DWORD GetMobDamageMin() const;
DWORD GetMobDamageMax() const;
WORD GetMobAttackRange() const;
DWORD GetMobDropItemVnum() const;
float GetMobDamageMultiply() const;
The thing is that i can't find the declaration of getmobtable so i think it takes them from data base,mob proto