|
You last visited: Today at 01:11
Advertisement
[QUESTION]Yang received based on your lvl
Discussion on [QUESTION]Yang received based on your lvl within the Metin2 Private Server forum part of the Metin2 category.
08/22/2015, 20:20
|
#1
|
elite*gold: 120
Join Date: Jul 2012
Posts: 219
Received Thanks: 6
|
[QUESTION]Yang received based on your lvl
I was thinking that since you get more or less exp based on the difference of your lvl and mob's lvl :
 .
If this thing is applying for yang too.
So i searched in source and i found this in char.h :
PHP Code:
INT GetGold() const { return m_points.gold; } void SetGold(INT gold) { m_points.gold = gold; } bool DropGold(INT gold); INT GetAllowedGold() const; void GiveGold(INT iAmount);
and in char.cpp:
PHP Code:
void CHARACTER::CreatePlayerProto(TPlayerTable & tab) { ... things tab.gold = GetGold(); ... things
and :
PHP Code:
INT CHARACTER::GetAllowedGold() const { if (GetLevel() <= 10) return 100000; else if (GetLevel() <= 20) return 500000; else return 50000000; }
The thing is that i still don't find what i am looking for ...
If you know it,if you found it,please tell me  i really want to know this thing ..
|
|
|
08/23/2015, 19:05
|
#2
|
elite*gold: 20
Join Date: Jun 2011
Posts: 2,901
Received Thanks: 3,342
|
search for references of GiveGold
|
|
|
08/24/2015, 12:35
|
#3
|
elite*gold: 120
Join Date: Jul 2012
Posts: 219
Received Thanks: 6
|
I found with a program "GiveGold" 227 times in 113 files ... xD
I will start looking but if someone knows already please post it because is too much for me to look in so many files xD
|
|
|
08/24/2015, 12:39
|
#4
|
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,764
|
If youre using VisualStudio (or any other IDE), this should work:
char.h:
Code:
void GiveGold(INT iAmount);
rightclick on "GiveGold" -> Open Declaration
|
|
|
08/24/2015, 12:54
|
#5
|
elite*gold: 120
Join Date: Jul 2012
Posts: 219
Received Thanks: 6
|
Bad searching ... it searched in .o files which are compressed and unreadable ....
I'm not using visual studio because i don't work with the source,i was just curious about this ... this is my first time i search in the source ...
I found these after another search in char_item.cpp :
PHP Code:
void CHARACTER::GiveGold(int iAmount)
{
if (iAmount <= 0)
return;
sys_log(0, "GIVE_GOLD: %s %d", GetName(), iAmount);
if (GetParty())
{
LPPARTY pParty = GetParty();
// 파티가 있는 경우 나누어 가진다.
DWORD dwTotal = iAmount;
DWORD dwMyAmount = dwTotal;
NPartyPickupDistribute::FCountNearMember funcCountNearMember(this);
pParty->ForEachOnlineMember(funcCountNearMember);
if (funcCountNearMember.total > 1)
{
DWORD dwShare = dwTotal / funcCountNearMember.total;
dwMyAmount -= dwShare * (funcCountNearMember.total - 1);
NPartyPickupDistribute::FMoneyDistributor funcMoneyDist(this, dwShare);
pParty->ForEachOnlineMember(funcMoneyDist);
}
PointChange(POINT_GOLD, dwMyAmount, true);
if (dwMyAmount > 1000) // 천원 이상만 기록한다.
LogManager::instance().CharLog(this, dwMyAmount, "GET_GOLD", "");
}
else
{
PointChange(POINT_GOLD, iAmount, true);
// 브라질에 돈이 없어진다는 버그가 있는데,
// 가능한 시나리오 중에 하나는,
// 메크로나, 핵을 써서 1000원 이하의 돈을 계속 버려 골드를 0으로 만들고,
// 돈이 없어졌다고 복구 신청하는 것일 수도 있다.
// 따라서 그런 경우를 잡기 위해 낮은 수치의 골드에 대해서도 로그를 남김.
if (LC_IsBrazil() == true)
{
if (iAmount >= 213)
LogManager::instance().CharLog(this, iAmount, "GET_GOLD", "");
}
else
{
if (iAmount > 1000) // 천원 이상만 기록한다.
LogManager::instance().CharLog(this, iAmount, "GET_GOLD", "");
}
}
}
This is the function,does it mean that the level doesn't interact with mob's level and you get the same amount of yang at the all levels by killing the same mob ?
You can also find another givegold in char_item.cpp and char_battle.cpp but i don't understant those sentences ... can you look there ?
|
|
|
08/24/2015, 13:04
|
#6
|
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,764
|
Now open the declaration of "PointChange" and edit the part in "case POINT_GOLD"
|
|
|
08/24/2015, 13:07
|
#7
|
elite*gold: 120
Join Date: Jul 2012
Posts: 219
Received Thanks: 6
|
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
|
|
|
 |
Similar Threads
|
Question about pvp based servers
07/28/2014 - Cabal Private Server - 0 Replies
I just want to know if there are any pvp-based (tierra gloriosa based maybe) servers with decent amount of people playing? Any suggestions are appreciated. Thanks in advance.
|
Question Auto free Silk/Hour based on the Online time
11/19/2012 - SRO Private Server - 4 Replies
Hello Epvpers.
I have a question about auto free silk per hour based on the online time per player.
It possible for me can add 10 silk for every hour that the player connected? :confused:
I know there is a post about that, but the creator of the post is banned and that I need to respond? :confused:
here is the post I told you about
http://www.elitepvpers.com/forum/private-sro-expl oits-hacks-bots-guides/1888938-release-auto-free-s ilk-hour-based-online-time-system.html
|
[Question] Memory based bot. How to start?
10/26/2012 - CO2 Programming - 31 Replies
Hello,
in order to make my very own little bot, I tried differents ways. First, I made a pixel bot, it was a success for myself, I've added lots of features but because it was only a pixel bot, it wasn't really efficient and adding advanced functions were very very hard.
After that, I tried to go further with another type of bot : proxies. The problem was, I was trying to code withtou basics knowledge and AutoIt is not really advised for that kind of bots. Thanks to pro4never, I achieved...
|
[Question]About packet based autopot
06/17/2010 - SRO Private Server - 5 Replies
Is there any packed based autopot that works with ZSZC server?
I know about the one for ECSRO,ECSRO VIP adn SWSRO but can't find any for ZSZC..
Tnx
|
[QUESTION] packet-based autopotion
12/18/2009 - SRO Private Server - 2 Replies
is there any?because its disturbing to use the keypressed-autopotion.. thanx for any help :handsdown:
|
All times are GMT +1. The time now is 01:12.
|
|