DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • September 23, 2018, 06:26:57 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: New Response for Armor Shop items  (Read 4154 times)
0 Members and 1 Guest are viewing this topic.
Jdrid
Guest
« on: March 08, 2006, 08:48:42 PM »

For certain items, I would like to make the game sound more realistic. If I make an armor item called 'Full Body Mail' I want the user to not say, 'Won't i look silly wearing nothing but a full body mail?' since he has bought full armor. I am giving this a shot here, please tell me if I am doing this right...
Here is some code I think I should add in armor.php, tell me if it would be correct...
Code:
if $session['user']['armor'] = $row['what I named the armor'];
   output("What I want player to say to Peagasus.");
and I'd be adding this before line 81.

Or can I create a simple module to do this?
I'd rather make a module than edit code I know.
Also please tell me if I am way off. I'd like to know how to get better with php. Thanks
Logged
Dragon89
Guest
« Reply #1 on: March 08, 2006, 08:53:14 PM »

Eth made a killer module called mystic shop.  It can do what you want and then some.  I would look at that if you want to see about doing your own thing.
Logged
Jdrid
Guest
« Reply #2 on: March 08, 2006, 08:57:13 PM »

Yes, but I wanted something to tie in with normal armor you buy fromt he armor shop. Not an addon shop. I may try this one out though.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5479



View Profile WWW
« Reply #3 on: March 08, 2006, 09:55:37 PM »

This is another place where you can accomplish a change using the translation tool.
Logged

Play the latest beta version here on DragonPrime
Jdrid
Guest
« Reply #4 on: March 08, 2006, 10:20:02 PM »

yes I know this but I wished for it to only show up on certain armor, such as all 15 strentgh armor. I know I could change it witht he translator but I only wanted it to show up for those 15 strentgh armor items.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #5 on: March 08, 2006, 10:53:15 PM »

This can be done with a module...

you would need to hook into "header-armor"...

In the dohook part check if "httget('op') == 'buy'" and if (httpget('id') == 15". If this statement evaluates to "FALSE" let you module end, if "TRUE", continue with the following:

copy lines 64 till 97 to your modules code, change the text you want to change, and then (IMPORTANT) call page_footer() from within the dohook()-function.

This will stop the normal code (outside of your module) to be continued.

PS: You might need line 15, too ...
Logged

Running for more than three years now:
Jdrid
Guest
« Reply #6 on: March 08, 2006, 11:00:11 PM »

k thanks for telling me how, hopefully I'll get this done by tonight, if not tommorrow...
Logged
Kendaer
Guest
« Reply #7 on: March 09, 2006, 07:02:28 PM »

This can be done with a module...

you would need to hook into "header-armor"...

In the dohook part check if "httget('op') == 'buy'" and if (httpget('id') == 15". If this statement evaluates to "FALSE" let you module end, if "TRUE", continue with the following:

copy lines 64 till 97 to your modules code, change the text you want to change, and then (IMPORTANT) call page_footer() from within the dohook()-function.

This will stop the normal code (outside of your module) to be continued.

PS: You might need line 15, too ...

What XChrisX has suggested would break if there were any other header-armor hooks being used for something.   Be very careful any time you choose to 'break out' of the hook handling like this.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #8 on: March 09, 2006, 09:25:10 PM »

What XChrisX has suggested would break if there were any other header-armor hooks being used for something.   Be very careful any time you choose to 'break out' of the hook handling like this.
And the funny part (to search for such errors: The break would only happen when you buy a level 15 armor... Grin

In no other case... Smiley

you might want to add your hook with the "module_addhook_priority()"-function...
Logged

Running for more than three years now:
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

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