Author Topic: How do I make this not spam..  (Read 313 times)

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
How do I make this not spam..
« on: January 23, 2013, 05:01:21 am »


               void main(){
object oObject =GetNearestObjectByTag("GS_GUILD");object oPC = GetEnteringObject();int nInstance = GetLocalInt(oObject, "GS_INSTANCE");object oTarget = GetNearestObjectByTag("dancer");
    if ( GetCampaignInt("GUILD", "DANCER") != nInstance ){
CreateObject(OBJECT_TYPE_CREATURE, "guild_dancer", GetLocation(oTarget));
}}

--------------------------------------------------------------

void main(){object oObject =GetNearestObjectByTag("GS_GUILD");    object oPC = GetPCSpeaker();int nInstance = GetLocalInt(oObject, "GS_INSTANCE");object oTarget = GetNearestObjectByTag("dancer"); if ( GetLocalInt(OBJECT_SELF, "DO_ONCE") )        FALSE;
SetCampaignInt("GUILD","DANCER",nInstance);CreateObject(OBJECT_TYPE_CREATURE, "guild_dancer", GetLocation(oTarget));TakeGoldFromCreature(10000, oPC, TRUE);SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE);
}

How do I script that it can't spawn more than one of the creature? Thank you.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
How do I make this not spam..
« Reply #1 on: January 23, 2013, 05:56:42 am »


               The top one can be done like so:

void main()
{
    object oPC     = GetEnteringObject();
    object oTarget = GetNearestObjectByTag("dancer");
    object oObject = GetNearestObjectByTag("GS_GUILD");
    int nInstance  = GetLocalInt(oObject, "GS_INSTANCE");

    if (GetCampaignInt("GUILD", "DANCER") != nInstance && GetLocalInt(OBJECT_SELF, "DO_ONCE"))
    {
        CreateObject(OBJECT_TYPE_CREATURE, "guild_dancer", GetLocation(oTarget));
        SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE);
    }
}

The bottom one should probably look like this:

void main()
{
    object oPC     = GetPCSpeaker();
    object oTarget = GetNearestObjectByTag("dancer");
    object oObject = GetNearestObjectByTag("GS_GUILD");
    int nInstance  = GetLocalInt(oObject, "GS_INSTANCE");

    if (GetLocalInt(OBJECT_SELF, "DO_ONCE"))
    {
        SetCampaignInt("GUILD", "DANCER", nInstance);
        CreateObject(OBJECT_TYPE_CREATURE, "guild_dancer", GetLocation(oTarget));
        TakeGoldFromCreature(10000, oPC, TRUE);
        SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE);
    }
}

               
               

               


                     Modifié par Squatting Monk, 23 janvier 2013 - 06:00 .