Author Topic: I need a bit of help  (Read 6890 times)

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
I need a bit of help
« on: June 25, 2004, 10:10:22 AM »
Usually 420's got me covered when I need help scripting(thanks 420! :lol: ) but I haven't seen 420 to ask him how to tag people so when they come into a mod they receive an item(like when the sents come in they get the sent stone thing)

Any one know how?

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a bit of help
« Reply #1 on: June 25, 2004, 05:29:14 PM »
Easiest way would be to set a "campaign" variable using the persons public CD key, account name or character name. (or a combination of all three)

So you can make an item for yourself that when you use it on people will toggle their "Sentinel" status. (I use "Official" instead of "Sentinel" in the scripts below.)

I just finished the custom drinks (whew, took forever) so Ill have more time to help with your scripting. I haven't started on the item filter (yet) but I can put up a sample of how to handle this.

This script should be activated by an item with the "Activate Item" or "Unique Power" property.
Quote
//Toggle "Official" status
//by: 420 6/25/04
//Make an item with a "Activate Item" or "Unique Power" property and name this
//script the same name as the items tag and make sure you have the tag based
//script in your Modules OnActivateItem event trigger

void main()
{
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();
string sName = GetName(oTarget);
string sCDKey = GetPCPublicCDKey(oTarget);
int iOfficial = GetCampaignInt("Official", sCDKey, oTarget);

if(iOfficial == 0)
    {
    SetCampaignInt("Official", sCDKey, 1, oTarget);
    FloatingTextStringOnCreature(sName+" is now an Official.", oPC, FALSE);
    }
else
    {
    DeleteCampaignVariable("Official", sCDKey, oTarget);
    FloatingTextStringOnCreature(sName+" is no longer an Official.", oPC, FALSE);
    }
}

Put this in: Module Properties/Events/OnClientEnter:
Quote
//Check "Official" status, give item to Officials
//by: 420 6/25/04
//Put in the OnClientEnter event trigger of the Module Properties

void main()
{
object oTarget = GetEnteringObject();
string sCDKey = GetPCPublicCDKey(oTarget);
int iOfficial = GetCampaignInt("Official", sCDKey, oTarget);

if(iOfficial == 1)
    {
    CreateItemOnObject("itemsblueprintresref", oTarget);
    }
}

This uses the players CDKey to determine if they are an "Official", if they are it creates the item with the Blueprint Resref "itemsblueprintresref".

Hope that helps,

420

EDIT: I made "ItemsBlueprintRresref" lowercase since Blueprint Resref can only be lower case. I also added a bunch of comments to both scripts
« Last Edit: June 25, 2004, 07:12:13 PM by 420 »

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
I need a bit of help
« Reply #2 on: June 25, 2004, 09:00:11 PM »
Thanks 420 you're the best. Maybe I should enlarge the tribute to you in my mod....

Well anyways can you send the item filter to me as soon as it's done? I finnished making the first quest in the mod which was when I had priorly deemed it the time to officially launch Rune(the name of my server, full name is
Quote
0 0 {DE} Rune
) Maybe I will wait till i finish making the first divine quest too...


Oh and (sry i don't mean to be bombarding you with requests and adding to your workload 420 but) have I asked you about the scripting for a duel manager type thing?


~Lord Elessar

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
I need a bit of help
« Reply #3 on: June 25, 2004, 10:04:20 PM »
Quote
Well anyways can you send the item filter to me as soon as it's done?

Oh and (sry i don't mean to be bombarding you with requests and adding to your workload 420 but) have I asked you about the scripting for a duel manager type thing?


~Lord Elessar
Just finished the item filter, I'll send it in a private message.

I'll work on the duel manager next.

420

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
I need a bit of help
« Reply #4 on: June 26, 2004, 08:48:51 AM »
thanks 420 :lol:  I'm gonna start making the tribute to you EVEN BIGGER! lol