Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Functions.h"
- int32_t Func::Shany_CompareItem(char* str, STRUCT_ITEM* item, int32_t loopIndex)
- {
- auto amount = BASE_GetItemAmount(item);
- if (loopIndex >= 0 && loopIndex <= 1)
- {
- if (item->Index == 3448)
- {
- if (amount < 10)
- {
- sprintf_s(str, 256, "Necessário Pacote de Lackterion com 10 unidades.");
- return 2;
- }
- return 1;
- }
- }
- return 0;
- }
- char* Func::ReadMessage(char* pMsg, int32_t pSize)
- {
- auto header = reinterpret_cast<MSG_STANDARD*>(pMsg);
- return pMsg;
- }
- bool Func::SetItemPriceString(STRUCT_ITEM* item, char* str)
- {
- /*switch (item->Index)
- {
- case 9999:
- sprintf(str, "Almas necessárias: %d", GetItemPrice(item->Index));
- return true;
- }*/
- return false;
- }
- int32_t Func::AddItemSanc(STRUCT_ITEM* item, char* str)
- {
- auto ret = BASE_GetItemAmount(item);
- if (ret > 0)
- sprintf(str, "%d", ret);
- else
- {
- ret = BASE_GetItemSanc(item);
- if (ret > 10)
- {
- if (ret >= 10 && ret < 14)
- ret = 10;
- else if (ret >= 14 && ret < 18)
- ret = 11;
- else if (ret >= 18 && ret < 22)
- ret = 12;
- else if (ret >= 22 && ret < 26)
- ret = 13;
- else if (ret >= 26 && ret < 30)
- ret = 14;
- else if (ret >= 30 && ret < 34)
- ret = 15;
- }
- sprintf(str, "+%d", ret);
- }
- return ret;
- }
- bool Func::AddAmountItem(int32_t itemID)
- {
- /*switch (itemID)
- {
- case 9999:
- return true;
- }*/
- return false;
- }
- int32_t Func::AddVolatileMessageItem(int32_t itemID)
- {
- switch (itemID)
- {
- case 5401:
- case 5402:
- case 5403:
- return 1;
- }
- return 0;
- }
- bool Func::SetVolatileMessageBoxText(int32_t itemID, char* text)
- {
- auto toRoman = [](uint32_t i) -> const char* {
- if (i == 1) return "I";
- else if (i == 2) return "II";
- else if (i == 3) return "III";
- else if (i == 4) return "IV";
- else if (i == 5) return "V";
- else if (i == 6) return "VI";
- else if (i == 7) return "VII";
- else if (i == 8) return "VIII";
- else if (i == 9) return "IX";
- else if (i == 10) return "X";
- else return "Undefined";
- };
- if (itemID >= 5401 && itemID <= 5403)
- {
- sprintf(text, "Quest Iniciante %s: Deseja continuar?", toRoman((itemID - 5400) + 1));
- return true;
- }
- return false;
- }
- int32_t Func::AddItemDescription(STRUCT_ITEM* item, char* line1, char* line2, char* line3, char* line4, DWORD* line1Color, DWORD* line2Color, DWORD* line3Color, DWORD* line4Color)
- {
- /*
- switch(item->Index)
- {
- case 9999:
- return 5;
- }
- */
- return 0;
- }
- enum Costumes
- {
- Valquiria = 1,
- Esqueleto,
- Romano,
- Kalintz_M,
- Kalintz_F,
- Draco,
- Bruxa,
- RedSanta,
- WhiteSanta,
- Purple_Rudolph = 0xD,
- Blue_Rudolph,
- White_Police,
- Black_Police,
- Blindness,
- Deafness,
- Hanbok,
- Rabbit_Girl,
- ST_Set,
- Kingdom_Red,
- Kingdom_Blue,
- Gandi,
- Odin,
- Rabbit,
- Dancing_Girl,
- Feudal,
- Oriental,
- Plant,
- Succubus,
- Oriental_F,
- Elegant,
- Dosa,
- Feudal_F,
- };
- void Func::AddIndex(int32_t index, int32_t* value)
- {
- switch (index)
- {
- case 4188: *value = RedSanta;
- break;
- case 4161:
- case 4187: *value = Purple_Rudolph;
- break;
- case 4162: *value = Blue_Rudolph;
- break;
- case 4163: *value = White_Police;
- break;
- case 4164: *value = Black_Police;
- break;
- case 4165: *value = Blindness;
- break;
- case 4166: *value = Deafness;
- break;
- case 4167: *value = Hanbok;
- break;
- case 4168: *value = Rabbit_Girl;
- break;
- case 4169:
- case 4170: *value = ST_Set;
- break;
- case 4171: *value = Kingdom_Red;
- break;
- case 4172: *value = Kingdom_Blue;
- break;
- case 4173:
- case 4186: *value = Gandi;
- break;
- case 4174:
- case 4185: *value = Odin;
- break;
- case 4175: *value = Dancing_Girl;
- break;
- case 4176: *value = Rabbit;
- break;
- case 4177: *value = Oriental;
- break;
- case 4178: *value = Feudal;
- break;
- case 4179: *value = Feudal_F;
- break;
- case 4183: *value = Elegant;
- break;
- case 4180: *value = Plant;
- break;
- case 4181: *value = Succubus;
- break;
- case 4182: *value = Oriental_F;
- break;
- case 4184:
- case 4150: *value = Dosa;
- break;
- default:
- break;
- }
- }
- void Func::CorrectBone(int32_t index, int32_t* bone)
- {
- switch (index)
- {
- case Valquiria:
- case Bruxa:
- case Romano:
- case Kalintz_F:
- case Purple_Rudolph:
- case Blue_Rudolph:
- case White_Police:
- case Black_Police:
- case Deafness:
- case Rabbit_Girl:
- case Rabbit:
- case Dancing_Girl:
- case Oriental:
- case Plant:
- case Succubus:
- case Oriental_F:
- case Elegant:
- case Hanbok:
- case Feudal_F:
- *bone = 0x1;
- break;
- case Draco:
- case Esqueleto:
- case Kalintz_M:
- case Feudal:
- case Kingdom_Blue:
- case Kingdom_Red:
- case Dosa:
- case Blindness:
- case ST_Set:
- case Gandi:
- case Odin:
- *bone = 0x0;
- break;
- default:
- break;
- }
- }
- void Func::LoadFile(int32_t index, char* textureName, char* meshName)
- {
- auto loadCostume = [textureName, meshName](char* texture, char* msh1, char* msh2, char* msh3, char* msh4, char* msh5, char* msh6)
- {
- auto counter = reinterpret_cast<int32_t*>(0x5EEECC);
- strcpy(textureName, texture);
- switch (*counter)
- {
- case 1:
- strcpy(meshName, msh1); *counter = 2;
- break;
- case 2:
- strcpy(meshName, msh2); *counter = 3;
- break;
- case 3:
- strcpy(meshName, msh3); *counter = 4;
- break;
- case 4:
- strcpy(meshName, msh4); *counter = 5;
- break;
- case 5:
- strcpy(meshName, msh5); *counter = 6;
- break;
- case 6:
- strcpy(meshName, msh6); *counter = 1;
- break;
- }
- };
- switch (index)
- {
- case Purple_Rudolph:
- loadCostume("mesh\\PurpleRudol.wyt", "mesh\\ch020194.msh", "mesh\\ch020294.msh", "mesh\\ch020394.msh", "mesh\\ch020494.msh", "mesh\\ch020594.msh", "mesh\\ch020694.msh");
- break;
- case Blue_Rudolph:
- loadCostume("mesh\\BlueRudol.wyt", "mesh\\ch020194.msh", "mesh\\ch020294.msh", "mesh\\ch020394.msh", "mesh\\ch020494.msh", "mesh\\ch020594.msh", "mesh\\ch020694.msh");
- break;
- case White_Police:
- loadCostume("mesh\\WhitePolice.wyt", "mesh\\ch020195.msh", "mesh\\ch020295.msh", "mesh\\ch020395.msh", "mesh\\ch020495.msh", "mesh\\ch020595.msh", "mesh\\ch020695.msh");
- break;
- case Black_Police:
- loadCostume("mesh\\BlackPolice.wyt", "mesh\\ch020195.msh", "mesh\\ch020295.msh", "mesh\\ch020395.msh", "mesh\\ch020495.msh", "mesh\\ch020595.msh", "mesh\\ch020695.msh");
- break;
- case Blindness:
- loadCostume("mesh\\DeathCos2.wyt", "mesh\\ch010189.msh", "mesh\\ch010289.msh", "mesh\\ch010389.msh", "mesh\\ch010489.msh", "mesh\\ch010589.msh", "mesh\\ch010689.msh");
- break;
- case Deafness:
- loadCostume("mesh\\DeathCos.wyt", "mesh\\ch020189.msh", "mesh\\ch020289.msh", "mesh\\ch020389.msh", "mesh\\ch020489.msh", "mesh\\ch020589.msh", "mesh\\ch020689.msh");
- break;
- case Dosa:
- loadCostume("mesh\\ch010199.wyt", "mesh\\ch010199.msh", "mesh\\ch010299.msh", "mesh\\ch010399.msh", "mesh\\ch010499.msh", "mesh\\ch010599.msh", "mesh\\ch010699.msh");
- break;
- case Hanbok:
- loadCostume("mesh\\ch0101100.wys", "mesh\\ch0101100.msh", "mesh\\ch0102100.msh", "mesh\\ch0103100.msh", "mesh\\ch0104100.msh", "mesh\\ch0105100.msh", "mesh\\ch0106100.msh");
- break;
- case Rabbit_Girl:
- loadCostume("mesh\\ch0101101.wys", "mesh\\ch0101101.msh", "mesh\\ch0102101.msh", "mesh\\ch0103101.msh", "mesh\\ch0104101.msh", "mesh\\ch0105101.msh", "mesh\\ch0106101.msh");
- break;
- case ST_Set:
- loadCostume("mesh\\ch0101102.wyt", "mesh\\ch0101102.msh", "mesh\\ch0102102.msh", "mesh\\ch0103102.msh", "mesh\\ch0104102.msh", "mesh\\ch0105102.msh", "mesh\\ch0106102.msh");
- break;
- case Kingdom_Red:
- loadCostume("mesh\\ch0101103.wyt", "mesh\\ch0101103.msh", "mesh\\ch0102103.msh", "mesh\\ch0103103.msh", "mesh\\ch0104103.msh", "mesh\\ch0105103.msh", "mesh\\ch0105103.msh");
- break;
- case Kingdom_Blue:
- loadCostume("mesh\\ch0102103.wyt", "mesh\\ch0101103.msh", "mesh\\ch0102103.msh", "mesh\\ch0103103.msh", "mesh\\ch0104103.msh", "mesh\\ch0105103.msh", "mesh\\ch0105103.msh");
- break;
- case Gandi:
- loadCostume("mesh\\ch0101104.wyt", "mesh\\ch0101104.msh", "mesh\\ch0102104.msh", "mesh\\ch0103104.msh", "mesh\\ch0104104.msh", "mesh\\ch0105104.msh", "mesh\\ch0106104.msh");
- break;
- case Odin:
- loadCostume("mesh\\ch0101106.wyt", "mesh\\ch0101106.msh", "mesh\\ch0102106.msh", "mesh\\ch0103106.msh", "mesh\\ch0104106.msh", "mesh\\ch0105106.msh", "mesh\\ch0106106.msh");
- break;
- case Rabbit:
- loadCostume("mesh\\ch0101107.wyt", "mesh\\ch0101107.msh", "mesh\\ch0102107.msh", "mesh\\ch0103107.msh", "mesh\\ch0104107.msh", "mesh\\ch0105107.msh", "mesh\\ch0106107.msh");
- break;
- case Oriental:
- loadCostume("mesh\\ch0101108.wyt", "mesh\\ch0101108.msh", "mesh\\ch0102108.msh", "mesh\\ch0103108.msh", "mesh\\ch0104108.msh", "mesh\\ch0105108.msh", "mesh\\ch0106108.msh");
- break;
- case Feudal:
- loadCostume("mesh\\ch0101109.wyt", "mesh\\ch0101109.msh", "mesh\\ch0102109.msh", "mesh\\ch0103109.msh", "mesh\\ch0104109.msh", "mesh\\ch0105109.msh", "mesh\\ch0106109.msh");
- break;
- case Dancing_Girl:
- loadCostume("mesh\\ch0101105.wyt", "mesh\\ch0101105.msh", "mesh\\ch0102105.msh", "mesh\\ch0103105.msh", "mesh\\ch0104105.msh", "mesh\\ch0105105.msh", "mesh\\ch0106105.msh");
- break;
- case Feudal_F:
- loadCostume("mesh\\ch0101110.wyt", "mesh\\ch0101110.msh", "mesh\\ch0102110.msh", "mesh\\ch0103110.msh", "mesh\\ch0104110.msh", "mesh\\ch0105110.msh", "mesh\\ch0106110.msh");
- break;
- case Plant:
- loadCostume("mesh\\ch0101111.wyt", "mesh\\ch0101111.msh", "mesh\\ch0102111.msh", "mesh\\ch0103111.msh", "mesh\\ch0104111.msh", "mesh\\ch0105111.msh", "mesh\\ch0106111.msh");
- break;
- case Succubus:
- loadCostume("mesh\\ch0101112.wyt", "mesh\\ch0101112.msh", "mesh\\ch0102112.msh", "mesh\\ch0103112.msh", "mesh\\ch0104112.msh", "mesh\\ch0105112.msh", "mesh\\ch0106112.msh");
- break;
- case Oriental_F:
- loadCostume("mesh\\ch0101113.wyt", "mesh\\ch0101113.msh", "mesh\\ch0102113.msh", "mesh\\ch0103113.msh", "mesh\\ch0104113.msh", "mesh\\ch0105113.msh", "mesh\\ch0106113.msh");
- break;
- case Elegant:
- loadCostume("mesh\\ch0101114.wyt", "mesh\\ch0101114.msh", "mesh\\ch0102114.msh", "mesh\\ch0103114.msh", "mesh\\ch0104114.msh", "mesh\\ch0105114.msh", "mesh\\ch0106114.msh");
- break;
- default:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement