[Spells] Update SPA 339 SE_TriggerOnCast (#1478)

* Recoded SE_TriggerOnCast Focus effect

Recoded SE_TriggerOnCast focus effect to be consistent with how all other focuses are checked. No longer an arbitrary limit as to number of a focus effects of this type you can have.

* new command: resetdisc_timer

usage: #resetdisc_timer [all | timer_id]

* syntax fixes

syntax improvements

* minor fix

changed numhits check

* Update spell_effects.cpp

* added better support for spell procs that don't require target.

* syntax

* Formatting and syntax tweaks

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
KayenEQ
2021-08-01 14:26:44 -04:00
committed by GitHub
parent 93b0264a8b
commit f01cf74fa6
9 changed files with 174 additions and 111 deletions
+36 -14
View File
@@ -359,6 +359,7 @@ int command_init(void)
command_add("repop", "[delay] - Repop the zone with optional delay", 100, command_repop) ||
command_add("resetaa", "- Resets a Player's AA in their profile and refunds spent AA's to unspent, may disconnect player.", 200, command_resetaa) ||
command_add("resetaa_timer", "Command to reset AA cooldown timers.", 200, command_resetaa_timer) ||
command_add("resetdisc_timer", "Command to reset all discipline cooldown timers.", 200, command_resetdisc_timer) ||
command_add("revoke", "[charname] [1/0] - Makes charname unable to talk on OOC", 200, command_revoke) ||
command_add("roambox", "Manages roambox settings for an NPC", 200, command_roambox) ||
command_add("rules", "(subcommand) - Manage server rules", 250, command_rules) ||
@@ -8121,31 +8122,31 @@ void command_summonitem(Client *c, const Seperator *sep)
).c_str()
);
}
if (arguments >= 2 && sep->IsNumber(2)) {
charges = atoi(sep->arg[2]);
}
if (arguments >= 3 && sep->IsNumber(3)) {
augment_one = atoi(sep->arg[3]);
}
if (arguments >= 4 && sep->IsNumber(4)) {
augment_two = atoi(sep->arg[4]);
}
if (arguments >= 5 && sep->IsNumber(5)) {
augment_three = atoi(sep->arg[5]);
}
if (arguments >= 6 && sep->IsNumber(6)) {
augment_four = atoi(sep->arg[6]);
}
if (arguments >= 7 && sep->IsNumber(7)) {
augment_five = atoi(sep->arg[7]);
}
if (arguments == 8 && sep->IsNumber(8)) {
augment_six = atoi(sep->arg[8]);
}
@@ -8189,7 +8190,7 @@ void command_giveitem(Client *c, const Seperator *sep)
c->Message(Chat::Red, "Usage: #giveitem [item id | link] [charges] [augment_one_id] [augment_two_id] [augment_three_id] [augment_four_id] [augment_five_id] [augment_six_id] (Charges are optional.)");
return;
}
Client *client_target = c->GetTarget()->CastToClient();
uint8 item_status = 0;
uint8 current_status = c->Admin();
@@ -8197,7 +8198,7 @@ void command_giveitem(Client *c, const Seperator *sep)
if (item) {
item_status = item->MinStatus;
}
if (item_status > current_status) {
c->Message(
Chat::White,
@@ -8209,23 +8210,23 @@ void command_giveitem(Client *c, const Seperator *sep)
);
return;
}
if (arguments >= 2 && sep->IsNumber(2)) {
charges = atoi(sep->arg[2]);
}
if (arguments >= 3 && sep->IsNumber(3)) {
augment_one = atoi(sep->arg[3]);
}
if (arguments >= 4 && sep->IsNumber(4)) {
augment_two = atoi(sep->arg[4]);
}
if (arguments >= 5 && sep->IsNumber(5)) {
augment_three = atoi(sep->arg[5]);
}
if (arguments >= 6 && sep->IsNumber(6)) {
augment_four = atoi(sep->arg[6]);
}
@@ -13725,6 +13726,27 @@ void command_resetaa_timer(Client *c, const Seperator *sep) {
}
}
void command_resetdisc_timer(Client *c, const Seperator *sep)
{
Client *target = c->GetTarget()->CastToClient();
if (!c->GetTarget() || !c->GetTarget()->IsClient()) {
target = c;
}
if (sep->IsNumber(1)) {
int timer_id = atoi(sep->arg[1]);
c->Message(Chat::White, "Reset of disc timer %i for %s", timer_id, c->GetName());
c->ResetDisciplineTimer(timer_id);
}
else if (!strcasecmp(sep->arg[1], "all")) {
c->Message(Chat::White, "Reset all disc timers for %s", c->GetName());
c->ResetAllDisciplineTimers();
}
else {
c->Message(Chat::White, "usage: #resetdisc_timer [all | timer_id]");
}
}
void command_reloadaa(Client *c, const Seperator *sep) {
c->Message(Chat::White, "Reloading Alternate Advancement Data...");
zone->LoadAlternateAdvancement();