spellEvent::spellEvent(tokenizer& t) : wowEvent(t) { spellID = asInt(t.token(9)); string spellName = t.token(10); trimQuotes(spellName); spells[spellID] = spellName; spellSchool = asuIntFromHexa(t.token(11)); }
damage::damage(tokenizer& t, int offset) { dmgDone = asInt(t.token(22+offset)); overkill = asInt(t.token(23+offset)); magicSchool = asInt(t.token(24+offset)); resisted = asInt(t.token(25 + offset)); blocked = asInt(t.token(26 + offset)); absorbed = asInt(t.token(27 + offset)); critical = asInt(t.token(28 + offset)); glancing = asInt(t.token(29 + offset)); crushing = asInt(t.token(30 + offset)); multistrike = asInt(t.token(31 + offset)); }
wowEvent::wowEvent(tokenizer&t) { time_ms = t.time_ms; string tmp = t.token(1); // sourceGUID sourceFlags = asuIntFromHexa(t.token(3)); #ifndef _DEBUG string sourceName; string destName; #else nr = ++count; if (nr == 2532) { nr = 2532; } #endif // DEBUG if (tmp != "0000000000000000") { sourceName = t.token(2); trimQuotes(sourceName); guidImpl source = guids.insert(tmp, sourceName); sourceGUID = source.guid; atype = source.type; } else { atype = Nil; } sourceRaidFlags = asuIntFromHexa(t.token(4)); tmp = t.token(5); // destGUID destName = t.token(6); trimQuotes(destName); destFlags = asuIntFromHexa(t.token(7)); destRaidFlags = asuIntFromHexa(t.token(8)); if (destName != "nil") { guidImpl dest = guids.insert(tmp, destName); destGUID = dest.guid; } } // wowEvent::wowEvent(tokenizer&t)
spellAuraRemovedDose::spellAuraRemovedDose(tokenizer& t) : spellAuraRemoved(t) { etype = SPELL_AURA_REMOVED_DOSE; amount = asInt(t.token(13)); }
spellAuraAppliedDose::spellAuraAppliedDose(tokenizer& t) : spellAuraApplied(t) { etype = SPELL_AURA_APPLIED_DOSE; amount = asInt(t.token(13)); }
spellAuraRefresh::spellAuraRefresh(tokenizer& t) : spellEvent(t) { etype = SPELL_AURA_REFRESH; buffOrDebuff = t.token(12);// Contains "BUFF" od "DEBUFF" }
spellAuraRemoved::spellAuraRemoved(tokenizer& t) : spellEvent(t) { etype = SPELL_AURA_REMOVED; buffOrDebuff = t.token(12);// Contains "BUFF" od "DEBUFF" }
spellAuraApplied::spellAuraApplied(tokenizer& t) : spellEvent(t) { etype = SPELL_AURA_APPLIED; buffOrDebuff = t.token(12);// Contains "BUFF" od "DEBUFF" }
spellCastFailed::spellCastFailed(tokenizer& t) : spellEvent(t) { etype = SPELL_CAST_FAILED; reason = t.token(12); trimQuotes(reason); // e.g. "Invalid target" }
sourceOrDestination::sourceOrDestination(tokenizer& t, int offset) { std::string tmp = t.token(9+offset); targetGuid = guids.insert(tmp, tmp).guid; tmp = t.token(10+offset); // this line is empirical, hate the lack of clear spec if (actorType(tmp) == Player) { masterGuid = guids.insert(tmp, tmp).guid; } else { masterGuid = 0; } hitPoints = asInt(t.token(11 + offset)); maxHitPoints = asInt(t.token(12 + offset)); attackPower = asInt(t.token(13 + offset)); spellPower = asInt(t.token(14 + offset)); resolve = asInt(t.token(15 + offset)); resourceType = asInt(t.token(16 + offset)); resourceAmount = asInt(t.token(17 + offset)); maxResourceAmount = asInt(t.token(18 + offset)); xPosition = asFloat(t.token(19 + offset)); //22 yPosition = asFloat(t.token(20 + offset)); //23 itemLevel = asInt(t.token(21 + offset)); // 24 }
bool wowEvent::savetoDB(tokenizer& t, int etype) { int rc; sqlite3_stmt* statement; list<dbField>::const_iterator it; dbField dbf; int ii, hash; unsigned int ui; float f; string s; dbTable& tbl = dbTables[etype]; statement = tbl.statement; if (statement == NULL) { return false; } rc = sqlite3_bind_int64(statement, 1, t.time_ms); for (it = tbl.fields.begin(); it != tbl.fields.end(); ++it) { dbf = *it; if (dbf.fieldtype == 'H') { ui = asuIntFromHexa(t.token(dbf.fieldpos)); rc = sqlite3_bind_int(statement, dbf.fieldpos, ui); } else if (dbf.fieldtype == 'I') { ii = asInt(t.token(dbf.fieldpos)); rc = sqlite3_bind_int(statement, dbf.fieldpos, ii); } else if (dbf.fieldtype == 'G') { s = t.token(dbf.fieldpos); trimQuotes(s); hash = hashString(s.c_str(), s.length()); rc = sqlite3_bind_int(statement, dbf.fieldpos, hash); } else if (dbf.fieldtype == 'B') { ii = asInt(t.token(dbf.fieldpos)); rc = sqlite3_bind_int(statement, dbf.fieldpos, ii); } else if (dbf.fieldtype == 'Q') { s = t.token(dbf.fieldpos); trimQuotes(s); rc = sqlite3_bind_text(statement, dbf.fieldpos, s.c_str(), s.length(), SQLITE_TRANSIENT); } else if (dbf.fieldtype == 'F') { f = asFloat(t.token(dbf.fieldpos)); rc = sqlite3_bind_double(statement, dbf.fieldpos, f); } } // for (it = tbl.fields.begin(); it != tbl.fields.end(); ++it) rc = sqlite3_step(statement); if ( rc!= SQLITE_DONE) { wcout << "Can't step, error: " << sqlite3_errmsg(db) << endl; } sqlite3_reset(statement); // sqlite3_clear_bindings(statement); return true; } // bool wowEvent::savetoDB(tokenizer& t, int etype)