Added admlevel script var and a couple bug fixes

This commit is contained in:
JamDog 2010-12-02 23:54:40 +00:00
parent 20bfcde9c9
commit 358d18b7fd
5 changed files with 24 additions and 3 deletions

View file

@ -35,6 +35,10 @@ export (QQ's a zone into a tarball)
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too)
@
[Dec 02 2010] - Jamdog
Bug-Fix: identify command in shops was listing incorrect buy price (thanks Kam)
Added %actor.admlevel% and %actor.admlevel(<level>)% to dg-scripts
Earthquake spell now misses flying people
[Dec 01 2010] - Jamdog
Fixed do_cheat so that only ID 1 can get a full restoration
Added zone checks for load/purge commands below admin level 3 (GrGod)

View file

@ -282,6 +282,7 @@ void snoop_check(struct char_data *ch);
bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_name);
bool AddRecentPlayer(char *chname, char *chhost, bool newplr, bool cpyplr);
void set_default_admin_privs(struct char_data *ch, bool keep_old);
int get_admin_level_by_string(char *lv);
/* Functions with subcommands */
/* do_date */
ACMD(do_date);

View file

@ -541,7 +541,17 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
switch (LOWER(*field)) {
case 'a':
if (!str_cmp(field, "level")) {
if (!str_cmp(field, "admlevel")) {
if (subfield && *subfield) {
int al;
if ((al = get_admin_level_by_string(subfield)) >= ADMLVL_MORTAL) {
if (IS_ADMIN(c, al))
strcpy(str, "1");
else
strcpy(str, "0");
} else
strcpy(str, "0");
} else
snprintf(str, slen, "%d", GET_ADMLEVEL(c));
}
if (!str_cmp(field, "affect")) {

View file

@ -658,7 +658,8 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
* 2: immortals
* 3: if no pk on this mud, skips over all players
* 4: pets (charmed NPCs)
* 5: other players in the same group (if the spell is 'violent') */
* 5: other players in the same group (if the spell is 'violent')
* 6: Flying people if earthquake is the spell */
if (tch == ch)
continue;
if (IS_ADMIN(tch, ADMLVL_IMMORT))
@ -672,6 +673,8 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
if (!IS_NPC(tch) && spell_info[spellnum].violent && AFF_FLAGGED(tch, AFF_GROUP) && AFF_FLAGGED(ch, AFF_GROUP) &&
( ((ch->master == NULL) ? ch : ch->master) == ((tch->master == NULL) ? tch : tch->master) ) )
continue;
if ((spellnum == SPELL_EARTHQUAKE) && AFF_FLAGGED(tch, AFF_FLYING))
continue;
/* Doesn't matter if they die here so we don't check. -gg 6/24/98 */
mag_damage(level, ch, tch, spellnum, 1);

View file

@ -1571,7 +1571,10 @@ bool shopping_identify(char *arg, struct char_data *ch, struct char_data *keeper
send_to_char(ch, "Name: %s\r\n", (obj->short_description) ? obj->short_description : "<None>");
sprinttype(GET_OBJ_TYPE(obj), item_types, buf, sizeof(buf));
send_to_char(ch, "Type: %s\r\n", buf);
send_to_char(ch, "Weight: %d, Cost to Buy: @Y%d@n\r\n", GET_OBJ_WEIGHT(obj), sell_price(obj, shop_nr, keeper, ch));
send_to_char(ch, "Weight: %d, Cost to Sell: %s%d%s, Cost to Buy: %s%d%s\r\n",
GET_OBJ_WEIGHT(obj),
QYEL, sell_price(obj, shop_nr, keeper, ch), QNRM,
QYEL, buy_price(obj, shop_nr, keeper, ch), QNRM);
sprintbitarray(GET_OBJ_WEAR(obj), wear_bits, TW_ARRAY_MAX, buf);
send_to_char(ch, "Can be worn on: %s\r\n", buf);