Guest User

Untitled

a guest
Apr 23rd, 2019
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const std::map<BYTE, std::string> change_visual_eq = {
  2. { PART_MAIN, "visual_eq.main" },
  3. { PART_WEAPON, "visual_eq.weapon" },
  4. { PART_HAIR, "visual_eq.hair" },
  5. { PART_SASH, "visual_eq.sash" },
  6. };
  7.  
  8. ACMD(do_change_visual_eq)
  9. {
  10. if (!ch)
  11. return;
  12.  
  13. if (ch->IsPolymorphed())
  14. {
  15. ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nie mozesz tego wykonac. Jestes przemieniony w potwora."));
  16. return;
  17. }
  18.  
  19. char arg1[256];
  20. one_argument(argument, arg1, sizeof(arg1));
  21. if (!*arg1)
  22. return;
  23.  
  24. BYTE partNum = PART_MAX_NUM;
  25. str_to_number(partNum, arg1);
  26.  
  27. if (change_visual_eq.find(partNum) != change_visual_eq.end())
  28. {
  29. std::string flagName = change_visual_eq.at(partNum);
  30. ch->SetQuestFlag(flagName, !ch->GetQuestFlag(flagName));
  31. ch->ComputePoints();
  32. }
  33. }
RAW Paste Data