- Katılım
- 7 Mart 2012
- Mesajlar
- 12,586
- Konu Yazar
- #1
Merhaba Arkadaslar Bu Gün Balıkçılık Balık Tutma için Kodları Vercem 19xx ve 20xx de geçerlidir
İlk Önce Define.h de #define ITEM_KILLING_BLADE 700037000 bunu arattırıp altına şunları Ekleyiniz
Sonra Packets.h de enum MiningSystemOpcodes Arattırın ve şunla değiştirin
Bu Kadar Arkdaslar Bir Teşekkürü Az Görmeyin Sizin İçin Çabalıyoruz Bir Şeyler Paylaşıyoruz Yorumda Yazanlar +++++ 11111 000 Tarzı Şeyler Eyer Bir Daha Böle Yazan Olursa Banlanır; Alıntı Yaparsanız Belirtin Alıntı Oldugunu
İlk Önce Define.h de #define ITEM_KILLING_BLADE 700037000 bunu arattırıp altına şunları Ekleyiniz
Kod:
[COLOR=#000000][COLOR=#FF8000]#define FISHING 191346000#define GOLDEN_FISHING 191347000
#define RAINWORM 508226000
#define EXP_FLASH 399127000
#define DC_FLASH 399128000
#define WAR_FLASH 399129000
[/COLOR] [/COLOR]
Sonra Packets.h de enum MiningSystemOpcodes Arattırın ve şunla değiştirin
Kod:
[COLOR=#000000] [COLOR=#0000BB]enum MiningSystemOpcodes[/COLOR][COLOR=#007700]{
[/COLOR][COLOR=#FF8000]// Starts the mining process
[/COLOR][COLOR=#0000BB]MiningStart [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Every n seconds, calls this packet to see if they found anything.
[/COLOR][COLOR=#0000BB]MiningAttempt [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Stops the mining process
[/COLOR][COLOR=#0000BB]MiningStop [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Fish Stard
[/COLOR][COLOR=#0000BB]FishingStart [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]6[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Fish Every n seconds, calls this packet to see if they found anything.
[/COLOR][COLOR=#0000BB]FishingAttempt [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]7[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Fish the mining process
[/COLOR][COLOR=#0000BB]FishingStop [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]8[/COLOR][COLOR=#007700],
[/COLOR][COLOR=#FF8000]// Soccer handler is part of the mining handler (yuck).
[/COLOR][COLOR=#0000BB]MiningSoccer [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]16[/COLOR][COLOR=#007700],
};
[/COLOR] [/COLOR]
Kod:
[COLOR=#333333][FONT=Source Sans Pro][B]Sonra Gamedefine.h de #define WEAPON_PICKAXE 61 altına şunu ekleyin
[/B][/FONT][/COLOR] [COLOR=#333333][FONT=monospace]#define WEAPON_FISHING 63 // Unlike the others, this is just the Kind field as-is (not / 10).[/FONT][/COLOR]
Kod:
Sonra INLINE bool isPickaxe() { return GetKind() == WEAPON_PICKAXE; } altına Şunu Ekleyin
[FONT=monospace]INLINE bool isFishing() { return GetKind() == WEAPON_FISHING; }[/FONT]
Kod:
Sonra User.h de void HandleMiningStop(Packet & pkt); Altına Şunu Ekleyin
Kod:
[COLOR=#333333][FONT=monospace]void HandleFishingStart(Packet & pkt);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] void HandleFishingAttempt(Packet & pkt);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] void HandleFishingStop(Packet & pkt);[/FONT][/COLOR]
Kod:
[COLOR=#333333][FONT=Source Sans Pro][B]Sonra User.cpp de void CUser::HandleMiningSystem(Packet & pkt) şunla Değiştirin
[/B][/FONT][/COLOR] [COLOR=#333333][FONT=monospace]void CUser::HandleFishingStart(Packet & pkt)[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace]{[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] Packet result(WIZ_MINING, uint8(FishingStart));[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] uint16 resultCode = MiningResultSuccess;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] // Are we mining already?[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] if (isMining())[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] resultCode = MiningResultMiningAlready;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] // Do we have a pickaxe? Is it worn?[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] _ITEM_DATA * pItem;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] _ITEM_TABLE * pTable = GetItemPrototype(RIGHTHAND, pItem);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] if (pItem == nullptr || pTable == nullptr[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] || pItem->sDuration <= 0[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] || !pTable->isFishing()[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] || GetItemCount(RAINWORM) <= 0)[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] resultCode = MiningResultNotPickaxe;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] result << resultCode;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] // If nothing went wrong, allow the user to start mining.[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] // Be sure to let everyone know we're mining.[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] if (resultCode == MiningResultSuccess)[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] {[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] m_bMining = true;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] result << GetID();[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] SendToRegion(&result);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] }[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] else[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] {[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] Send(&result);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] }[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace]}[/FONT][/COLOR]
Kod:
[COLOR=#333333][FONT=Source Sans Pro][B]Daha Sonra Şunu Ekleyin
[/B][/FONT][/COLOR] [COLOR=#333333][FONT=Source Sans Pro]void CUser::HandleFishingAttempt(Packet & pkt)[/FONT][/COLOR][COLOR=#333333][FONT=Source Sans Pro]{
if (!isMining())
return;
Packet result(WIZ_MINING, uint8(FishingAttempt));
uint16 resultCode = MiningResultSuccess;
// Do we have a pickaxe? Is it worn?
_ITEM_DATA * pItem;
_ITEM_TABLE * pTable = GetItemPrototype(RIGHTHAND, pItem);
if (pItem == nullptr || pTable == nullptr
|| pItem->sDuration <= 0 // are we supposed to wear the pickaxe on use? Need to verify.
|| !pTable->isFishing()
|| GetItemCount(RAINWORM) <= 0)
resultCode = MiningResultNotPickaxe;
// Check to make sure we're not spamming the packet...
if ((UNIXTIME - m_tLastMiningAttempt) < MINING_DELAY)
resultCode = MiningResultMiningAlready; // as close an error as we're going to get...
// Effect to show to clients
uint16 sEffect = 0;
// This is just a mock-up based on another codebase's implementation.
// Need to log official data to get a proper idea of how it behaves, rate-wise,
// so that we can then implement it more dynamically.
if (resultCode == MiningResultSuccess)
{
int rate = myrand(1, 100), random = myrand(1, 10000);
if (GetPremiumProperty(PremiumDropPercent) > 0)
{
rate += (rate / 100) * GetPremiumProperty(PremiumDropPercent);
random += (rate / 100) * GetPremiumProperty(PremiumDropPercent);
}
if (pTable->m_iNum == GOLDEN_FISHING)
{
rate += (rate / 100) * 10;
random += (random / 100) * 10;
}
if (rate > 100)
rate = 100;
if (random > 10000)
random = 10000;
if (rate <= 50 && random <= 5000)
{
if (GetLevel() >= 35 && GetLevel() <= 59)
ExpChange(100);
if (GetLevel() >= 60 && GetLevel() <= 69)
ExpChange(200);
if (GetLevel() >= 70)
ExpChange(300);
sEffect = 13082; // "XP" effect
}
else if (rate >= 45 && rate <= 50 && random <= 8000)
{
if (pTable->m_iNum == GOLDEN_FISHING)
GiveItem(g_pMain->f_Drop1);
if (pTable->m_iNum == FISHING)
GiveItem(g_pMain->gf_Drop1);
sEffect = 30730; // "Fish" effect
}
else if (rate >= 60 && rate <= 75 && random <= 9000)
{
if (pTable->m_iNum == GOLDEN_FISHING)
GiveItem(g_pMain->f_Drop2);
if (pTable->m_iNum == FISHING)
GiveItem(g_pMain->gf_Drop2);
sEffect = 30730; // "Fish" effect
}
else if (rate >= 75 && rate <= 100 && random <= 10000)
{
if (pTable->m_iNum == GOLDEN_FISHING)
GiveItem(g_pMain->f_Drop3);
if (pTable->m_iNum == FISHING)
GiveItem(g_pMain->gf_Drop3);
sEffect = 30730; // "Fish" effect
}
else
{
sEffect = 30731; // "Fail" effect
}
m_tLastMiningAttempt = UNIXTIME;
}
result << resultCode << GetID() << sEffect;
RobItem(RAINWORM,1);
ItemWoreOut(ATTACK,100);
if (resultCode != MiningResultSuccess
&& resultCode != MiningResultNothingFound)
{
// Tell us the error first
Send(&result);
// and then tell the client to stop mining
HandleFishingStop(pkt);
return;
}
if(resultCode != MiningResultNothingFound)
SendToRegion(&result);
else if(resultCode == MiningResultNothingFound)
Send(&result);
}
[/FONT][/COLOR]
Kod:
[COLOR=#333333][FONT=Source Sans Pro][B]Sonra Şunu Ekleyin
[/B][/FONT][/COLOR] [COLOR=#333333][FONT=monospace]void CUser::HandleFishingStop(Packet & pkt)[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace]{[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] if (!isMining())[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] return;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] Packet result(WIZ_MINING, uint8(FishingStop));[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] result << uint16(1) << GetID();[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] m_bMining = false;[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace] SendToRegion(&result);[/FONT][/COLOR]
[COLOR=#333333][FONT=monospace]}[/FONT][/COLOR]
Bu Kadar Arkdaslar Bir Teşekkürü Az Görmeyin Sizin İçin Çabalıyoruz Bir Şeyler Paylaşıyoruz Yorumda Yazanlar +++++ 11111 000 Tarzı Şeyler Eyer Bir Daha Böle Yazan Olursa Banlanır; Alıntı Yaparsanız Belirtin Alıntı Oldugunu