Developer Store
Support
Member Forums

Screenshots
FAQ
Documentation
License
Known Issues
Downloads

MMOWorkshop.com Store Opened!
Torque MMO Kit - Open Sourced!
Torque MMO Kit - 1.5.2 Port Alpha Test
Torque MMO Kit - OSX Status

GarageGames.com irc.prairiegames.com
#mmoworkshop

PyTorque
TGB Web Browser


Zortek

hallsofvalhalla - After a long epiphany
Leathel - FoHO pre-Alpha 2.42
OldRod - More Musings on the MMO Industry
xapken - nice
J.C. Smith - 0.0.4.1 Build Notes
Wolf Dreamer - Pointless blog of pointless things
AthlonJedi2 - Server Nuked !!!!!
gamer_goof - New character model GIRL1 available only $4
... MORE BLOGS!

Lets talk skills.
Mob chase range?
Auction House + Internal Mail Sy...
Crafting Wiki
Every Day a new question... :)
Web Host
Seeking experienced programmer
Integrating Green-Ear SDK (paid)
where character information is s...
Spells Problem...

Changeset 1594

Show
Ignore:
Timestamp:
06/23/08 09:52:39 (4 months ago)
Author:
Llarlen
Message:
  • Removed the no longer useable cextract immortal command.
  • Added a '/imm checkwealth' immortal command. The command requires a valid target and lists the targets wealth in all realms.
  • Added a '/imm setwealth <realm = light/darkness/monster> <amount in tin>' immortal command. The command requires a valid target and logs command useage.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/games/minionsofmirth/v1/testing/mud/world/immortalcommand.py

    r1339 r1594  
    10541054 
    10551055 
    1056 def CmdCExtract(mob, args): 
    1057     from mud.worldserver.charutil import ExtractCharacters 
    1058     ExtractCharacters(mob.player.party.members) 
    1059  
    1060  
    10611056def CmdTestAFX(mob, args): 
    10621057    if not len(args): 
     
    10761071 
    10771072 
     1073def CmdCheckWealth(mob, args): 
     1074    # Check if there is a target available. 
     1075    if not mob.target: 
     1076        mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 
     1077            "This command requires a target.\\n") 
     1078        return 
     1079     
     1080    # Get a handle to the targets player. 
     1081    tplayer = mob.target.player 
     1082     
     1083    # Query the targets wealth. 
     1084    ext = ('pp','gp','sp','cp','tp') 
     1085    worthLight = (tplayer.lightPlatinum,tplayer.lightGold,tplayer.lightSilver, \ 
     1086        tplayer.lightCopper,tplayer.lightTin) 
     1087    lightString = ', '.join('%i%s'%(w,ext[i]) \ 
     1088        for i,w in enumerate(worthLight) if w != 0) 
     1089    worthDarkness = (tplayer.darknessPlatinum,tplayer.darknessGold, \ 
     1090        tplayer.darknessSilver,tplayer.darknessCopper,tplayer.darknessTin) 
     1091    darknessString = ', '.join('%i%s'%(w,ext[i]) \ 
     1092        for i,w in enumerate(worthDarkness) if w != 0) 
     1093    worthMonster = (tplayer.monsterPlatinum,tplayer.monsterGold, \ 
     1094        tplayer.monsterSilver,tplayer.monsterCopper,tplayer.monsterTin) 
     1095    monsterString = ', '.join('%i%s'%(w,ext[i]) \ 
     1096        for i,w in enumerate(worthMonster) if w != 0) 
     1097     
     1098    # And print the result to the immortal. 
     1099    mob.player.sendGameText(RPG_MSG_GAME_WHITE, \ 
     1100        "%s's wealth:\\n Light: %s\\n Darkness: %s\\n Monster: %s\\n"% \ 
     1101        (mob.target.name,lightString,darknessString,monsterString)) 
     1102 
     1103 
     1104def CmdSetWealth(mob, args): 
     1105    # Check if there is a target available. 
     1106    if not mob.target: 
     1107        mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 
     1108            "This command requires a target.\\n") 
     1109        return 
     1110     
     1111    # Check if the two needed arguments are present. 
     1112    if len(args) != 2: 
     1113        mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 
     1114            "Number of supplied arguments incorrect.\\nUsage: /imm setwealth <realm = light/darkness/monster> <amount in tin>.\\n") 
     1115        return 
     1116     
     1117    # Extract the desired amount of money to set the targets wealth to. 
     1118    try: 
     1119        tp,cp,sp,gp,pp = CollapseMoney(int(args[1])) 
     1120    except ValueError: 
     1121        mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 
     1122            "Can't extract amount of tin argument.\\nUsage: /imm setwealth <realm = light/darkness/monster> <amount in tin>.\\n") 
     1123        return 
     1124     
     1125    # Get a handle to the targets player. 
     1126    tplayer = mob.target.player 
     1127     
     1128    # Extract the realm and set wealth to the new value. 
     1129    realmText = args[0].upper() 
     1130    if realmText == 'LIGHT': 
     1131        tplayer.lightTin = tp 
     1132        tplayer.lightCopper = cp 
     1133        tplayer.lightSilver = sp 
     1134        tplayer.lightGold = gp 
     1135        tplayer.lightPlatinum = pp 
     1136    elif realmText == 'DARKNESS': 
     1137        tplayer.darknessTin = tp 
     1138        tplayer.darknessCopper = cp 
     1139        tplayer.darknessSilver = sp 
     1140        tplayer.darknessGold = gp 
     1141        tplayer.darknessPlatinum = pp 
     1142    elif realmText == 'MONSTER': 
     1143        tplayer.monsterTin = tp 
     1144        tplayer.monsterCopper = cp 
     1145        tplayer.monsterSilver = sp 
     1146        tplayer.monsterGold = gp 
     1147        tplayer.monsterPlatinum = pp 
     1148    else: 
     1149        mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 
     1150            "Can't extract realm argument.\\nUsage: /imm setwealth <realm = light/darkness/monster> <amount in tin>.\\n") 
     1151        return 
     1152     
     1153    # Generate the money string. 
     1154    ext = ('pp','gp','sp','cp','tp') 
     1155    worth = (pp,gp,sp,cp,tp) 
     1156    moneyString = ', '.join('%i%s'%(w,ext[i]) for i,w in enumerate(worth) if w != 0) 
     1157     
     1158    # Print result to the immortal and log. 
     1159    mob.player.sendGameText(RPG_MSG_GAME_WHITE, \ 
     1160        "%s's wealth in the %s realm has been set to: %s.\\nPlease inform the player once all adjustments have taken place.\\n"%(mob.target.name,args[0],moneyString)) 
     1161    print "Immortal %s has set %s's wealth in the %s realm to %s."% \ 
     1162        (mob.player.publicName,tplayer.fantasyName,args[0],moneyString) 
     1163     
     1164    # Informing the player about the change is left up to the immortal. 
     1165    # Maybe several changes have to be made before the player should be informed. 
     1166 
     1167 
    10781168 
    10791169COMMANDS = {} 
     
    11121202COMMANDS['DENY'] = CmdDeny 
    11131203 
    1114 COMMANDS['CEXTRACT'] = CmdCExtract 
    1115  
    11161204COMMANDS['TESTAFX'] = CmdTestAFX 
    11171205COMMANDS['GETDIMENSIONS'] = CmdGetDimensions 
     1206 
     1207COMMANDS['CHECKWEALTH'] = CmdCheckWealth 
     1208COMMANDS['SETWEALTH'] = CmdSetWealth 
    11181209 
    11191210