Added $client->GetMoney(type, subtype) to Perl/Lua.

Types:
- 0: Copper
- 1: Silver
- 2: Gold
- 3: Platinum
Sub Types (if applicable):
- 0: On Character
- 1: In Bank
- 2: On Cursor
- 3: Shared Bank (only applies to Type 3/Platinum)
This commit is contained in:
Kinglykrab
2015-08-01 00:11:18 -04:00
parent 7fc8841a67
commit 892fb58b18
5 changed files with 116 additions and 1 deletions
+76
View File
@@ -8592,3 +8592,79 @@ void Client::SendHPUpdateMarquee(){
std::string health_update_notification = StringFormat("Health: %u%%", health_percentage);
this->SendMarqueeMessage(15, 510, 0, 3000, 3000, health_update_notification);
}
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
uint32 value = 0;
switch (type) {
case 0: {
switch (subtype) {
case 0:
value = static_cast<uint32>(m_pp.copper);
break;
case 1:
value = static_cast<uint32>(m_pp.copper_bank);
break;
case 2:
value = static_cast<uint32>(m_pp.copper_cursor);
break;
default:
break;
}
break;
}
case 1: {
switch (subtype) {
case 0:
value = static_cast<uint32>(m_pp.silver);
break;
case 1:
value = static_cast<uint32>(m_pp.silver_bank);
break;
case 2:
value = static_cast<uint32>(m_pp.silver_cursor);
break;
default:
break;
}
break;
}
case 2: {
switch (subtype) {
case 0:
value = static_cast<uint32>(m_pp.gold);
break;
case 1:
value = static_cast<uint32>(m_pp.gold_bank);
break;
case 2:
value = static_cast<uint32>(m_pp.gold_cursor);
break;
default:
break;
}
break;
}
case 3: {
switch (subtype) {
case 0:
value = static_cast<uint32>(m_pp.platinum);
break;
case 1:
value = static_cast<uint32>(m_pp.platinum_bank);
break;
case 2:
value = static_cast<uint32>(m_pp.platinum_cursor);
break;
case 3:
value = static_cast<uint32>(m_pp.platinum_shared);
break;
default:
break;
}
break;
}
default:
break;
}
return value;
}