Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. ACMD(do_toggle_costume)
  2. {
  3.     char arg1[256];
  4.     one_argument(argument, arg1, sizeof(arg1));
  5.     if (!arg1) return;
  6.     EParts toSetPart = PART_MAX_NUM;
  7.     CItem* pItem;
  8.     switch(arg1) {
  9.         case 1 :
  10.             toSetPart = PART_HAIR;
  11.             pItem = ch->GetWear(WEAR_COSTUME_HAIR);
  12.             break;
  13.         case 2 :
  14.             toSetPart = PART_BODY;
  15.             pItem = ch->GetWear(WEAR_COSTUME_BODY);
  16.             break;
  17.         case 3 :
  18.             toSetPart = PART_WEAPON;
  19.             pItem = ch->GetWear(WEAR_COSTUME_WEAPON);
  20.             break;
  21.     }
  22.     if (ch->IsPolymorphed()) return;
  23.     if (!pItem) return;
  24.     if (PART_MAX_NUM == toSetPart) return;
  25.     DWORD toSetValue = pItem->GetVnum();
  26.     toSetValue = pFryzura->GetValue(3);
  27.     bool b = ch->GetFlag("costume_tgl.part" + arg1);
  28.     ch->SetQuestFlag("costume_tgl.part" + arg1, b ? 0 : 1);
  29.     ch->SetPart((BYTE)toSetPart, b ? 0 : toSetValue);
  30.     ch->UpdatePacket();
  31.     ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(b ? "OFF" : "ON"));
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement