MCPcopy Create free account
hub / github.com/Norbyte/ositools / SkillSetCooldown

Function SkillSetCooldown

OsiInterface/Functions/PlayerFunctions.cpp:34–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33
34 void SkillSetCooldown(OsiArgumentDesc const & args)
35 {
36 auto characterGuid = args[0].String;
37 auto character = FindCharacterByNameGuid(characterGuid);
38 if (character == nullptr) {
39 OsiError("Character '" << characterGuid << "' does not exist!");
40 return;
41 }
42
43 if (character->SkillManager == nullptr) {
44 OsiError("Character '" << characterGuid << "' has no SkillManager!");
45 return;
46 }
47
48 auto skillId = args[1].String;
49 auto skill = character->SkillManager->Skills.Find(skillId);
50 if (skill == nullptr) {
51 OsiError("Character '" << characterGuid << "' doesn't have skill '" << skillId << "'!");
52 return;
53 }
54
55 if ((*skill)->OncePerCombat) {
56 OsiError("Skill '" << skillId << " doesn't support cooldown!");
57 return;
58 }
59
60 auto cooldown = args[2].Float;
61 if (cooldown < 0.0f) {
62 OsiError("Cooldown cannot be negative!");
63 return;
64 }
65
66 (*skill)->ActiveCooldown = cooldown;
67 }
68
69 ObjectSet<esv::SkillBarItem> * GetSkillBar(char const * characterGuid)
70 {

Callers

nothing calls this directly

Calls 2

FindCharacterByNameGuidFunction · 0.85
FindMethod · 0.45

Tested by

no test coverage detected