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

Function SkillGetCooldown

OsiInterface/Functions/PlayerFunctions.cpp:9–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7 namespace func
8 {
9 bool SkillGetCooldown(OsiArgumentDesc & args)
10 {
11 auto characterGuid = args[0].String;
12 auto character = FindCharacterByNameGuid(characterGuid);
13 if (character == nullptr) {
14 OsiError("Character '" << characterGuid << "' does not exist!");
15 return false;
16 }
17
18 if (character->SkillManager == nullptr) {
19 OsiError("Character '" << characterGuid << "' has no SkillManager!");
20 return false;
21 }
22
23 auto skillId = args[1].String;
24 auto skill = character->SkillManager->Skills.Find(skillId);
25 if (skill == nullptr) {
26 OsiError("Character '" << characterGuid << "' doesn't have skill '" << skillId << "'!");
27 return false;
28 }
29
30 args[2].Float = (*skill)->ActiveCooldown;
31 return true;
32 }
33
34 void SkillSetCooldown(OsiArgumentDesc const & args)
35 {

Callers

nothing calls this directly

Calls 2

FindCharacterByNameGuidFunction · 0.85
FindMethod · 0.45

Tested by

no test coverage detected