feat. Add option to Learn or cast spells (#30)

* feat. Add option to Learn or cast spells

* boolean learn attribute
This commit is contained in:
Walter Pagani 2023-09-05 05:17:05 -03:00 committed by GitHub
parent 8e4aef41dc
commit 494cde182c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 104 additions and 69 deletions

View file

@ -94,11 +94,16 @@ uint32 giveAward(Player* player)
money += fields[1].Get<uint32>() * GOLD;
}
if (fields[2].Get<uint32>() > 0)
player->CastSpell(player, fields[2].Get<uint32>());
if (fields[3].Get<uint32>() > 0)
player->AddItem(fields[3].Get<uint32>(), 1);
if (fields[4].Get<uint32>())
{
if (fields[3].Get<uint32>() == 0)
player->CastSpell(player, fields[2].Get<uint32>());
else
player->learnSpell(fields[2].Get<uint32>());
}
if (fields[4].Get<uint32>() > 0)
player->AddItem(fields[4].Get<uint32>(), 1);
if (fields[5].Get<uint32>())
player->AddItem(fields[5].Get<uint32>(), 1);
}
while (result->NextRow());