DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • May 26, 2019, 12:00:40 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Proposed Specialty Changes - Inn  (Read 3400 times)
0 Members and 1 Guest are viewing this topic.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« on: January 25, 2005, 01:04:50 PM »

Okay, you go in the Inn, bribe the Bartender, switch specialty... but hey! All of them show up! WTF?!?!?

Replace:
Code:
case "specialtynames":
$args[$spec] = translate_inline($name);
break;
With:
Code:
   case "specialtynames":
      $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
      if ($session['user']['superuser'] & SU_EDIT_USERS || $session['user']['dragonkills'] >= get_module_setting("mindk") || get_module_setting("cost") <= $pointsavailable){
      $args[$spec] = translate_inline($name);
      }
      break;

NOTE: This is only needed for Specialties that have a MinDK requirement or a Donation Requirement.
« Last Edit: January 25, 2005, 03:42:20 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Kendaer
Guest
« Reply #1 on: January 25, 2005, 02:43:26 PM »

Better Sichae, would be to have your specialty check in the specialtynames if that character could have that specialty.

Doing that would however have one small side effect which would be problematic.
It would cause the usereditor dropdown of specialties to show only the ones which the admin had access to (but since they are admins, chances are that should be all of them) or else your code should handle it and allow admins with user editor privs to choose any specialty regardless.

IE, you should write your specialtynames case in dohook as  (in psuedocode)

Code:
case "specialtyname":
     check conditions
     if not allowed break
     add the specialty to the args array
     break

Don't go making the code more confusing for no reason Smiley
     
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #2 on: January 25, 2005, 03:03:44 PM »

Okay, so we shall nix the changes I posted firstly and change it to:

Replace:
Code:
case "specialtynames":
$args[$spec] = translate_inline($name);
break;
With:
Code:
   case "specialtynames":
      $pointsavailable = $session['user']['donation'] - $session['user']['donationspent'];
      if ($session['user']['superuser'] & SU_EDIT_USERS || $session['user']['dragonkills'] >= get_module_setting("mindk") || get_module_setting("cost") <= $pointsavailable){
      $args[$spec] = translate_inline($name);
      }
      break;

All done, and working.
« Last Edit: January 25, 2005, 03:42:30 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
109 Guests, 1 User
Daenerys
Home Forums News Downloads Login Register Advanced Search